Comments (1)
Hi @marrog, I can confirm this is a real issue.
It occurs because csvwlib binds a whole pile of prefixes & namespaces to the rdflib Graph()
(see https://github.com/DerwenAI/csvwlib/blob/master/csvwlib/utils/rdf/Namespaces.py#L13) and then the rdflib-jsonld serializer puts everything in the graph's namespaces list into the context (see https://github.com/RDFLib/rdflib-jsonld/blob/master/rdflib_jsonld/serializer.py#L116). This only occurs for JSON-LD and not any other "default" RDF format because the serializers are completely independent.
A real solution here would be to introduce a checker into the rdflib-jsonld code to ensure only used namespaces are placed into Context. Another solution would be to do a similar thing in csvwlib i.d. only bind used prefixes to the graph.
While I think either or both could be done, I would have to check if it's expected JSON-LD behaviour: perhaps there is no requirement that context be limited in this way - to used context elements only - and there may even be reasons why it's not desired, but I suspect that it is not desired behaviour.
Sorry I don't know already, I'm pretty new to JSON-LD as I'm actually one of the rdflib maintainers and have sort of inherited rdflib-jsonld.
I'm not going to be able to fix this any time soon - I'm preoccupied with merging rdflib-jsonld into rdflib main library and adding JSON-LD 1.1 support - so I'd love any external contributions for this.
from rdflib-jsonld.
Related Issues (20)
- Parsing of @context string fails HOT 1
- JSON-LD data import adds trailing slashes to IRIs HOT 2
- RDFS Type to @type property HOT 3
- jsonld with multiple datasets
- JSON-LD Star, YAML-LD Star HOT 1
- YAML-LD HOT 1
- v0.4.0 fails to parse what 0.5.0.dev0 can HOT 2
- Doesn't interpret newlines with python3 HOT 3
- Hierarchical JSON and @reverse
- HTTP Error 500: Internal Server Error => JSONDecodeError HOT 16
- Schema.org moving from HTTP Content Negotiation to JSON-LD 1.1 "Link:" header for context file HOT 9
- Aliased property serialized with namespace HOT 1
- Calling rdflib.tools.rdfpipe results in AttributeError: 'str' object has no attribute 'decode' HOT 1
- Compact serialization HOT 7
- Broken stdin (-) handling HOT 2
- Support JSON-LD Framing HOT 1
- Cannot parse JSON-LD document if the scheme of @base IRI is non-standard HOT 1
- On parsing, @included section is ignored unless the JSON-LD document is flattened
- Parse all the data in the json-ld file?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rdflib-jsonld.