-
Notifications
You must be signed in to change notification settings - Fork 579
Open
Description
I noticed that when we provide a string that is not a IRI to a field that is expected to be an IRI then RDFLib generates an IRI using
e.g. for this JSON-LD (schema.org defines license as an IRI)
{
"@context": "http://schema.org",
"license": "notspecified"
}After parsing and serializing back to turtle I get (path being the current path):
schema:license <file:///Users/vemonet/dev/notspecified> ;It seems a bit like a hacky behavior to generate the IRI. Is this really needed? In which use-case is this actually relevant to have this behavior?
What could be a better behavior?
- Throw an error? Arguably the RDF we try to parse is faulty, and for reliability throwing an error would be better than silently altering the underlying data (there could be a
strict=Trueparam on the parser), which can cause many more problem down the road - Use a named blank node instead of an IRI (I am not a big fan of blank nodes though...)
- Generates an IRI without using the absolute current working directory path
I can look into this and implement the changes if ok
Metadata
Metadata
Assignees
Labels
No labels