Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSet a @base before json-ld -> rdf nquads #5
Comments
Much much faster (and simpler) than manual expansion with `@base`. Follow-up on #5
Otherwise
jsonld::jsonld_to_rdfwill drop triples if theidis not a URI. Setting a@baseto the document URL / document path is the standard behavior (e.g. in json-ld.org/playground, or python rdflib), see ropensci/jsonld#9.Not obvious what this base should be. One option is the anonymous id
"@base": "_:", which will replace the local ids with ids like JSON-LD does for anonymous objects (elements that didn't declare an@id), i.e._:b0,_:b1, etc. This destroys the original string used as the id, which semantically shouldn't matter but is probably not nice all the same.Other libraries just set the base to the file path, i.e.
"@base": "some:url/or/local/path", which seems a bit arbitrary, particularly when it's exposing full user paths in the data somewhat surreptitiously. Maybe a default like"@base": "doc:"would be best.