Comments (2)
As a workaround you can write your second prefix directly into the default memory store.
from rdflib import Graph, Namespace, URIRef
EX = Namespace("http://example.org/")
g = Graph(bind_namespaces="none")
g.bind("ex", EX)
g.store._Memory__namespace["ex1"] = URIRef("http://example.org/")
print(list(g.namespaces()))
#[('ex', rdflib.term.URIRef('http://example.org/')), ('ex1', rdflib.term.URIRef('http://example.org/'))]
I havent tested this any further. So dont know if there will be any problems or other stores will behave in the same manner.
from rdflib.
The base issue could be a real one and I will look into it when I'm back from holidays in a few weeks.
But the multi prefixes one is not! Sure, it's not a violation to want to have multiple prefixes for the same namespace and you do see it in data but prefixes are just presentation conveniences and I think that too much catering for every possible use of them overemphasises their role. They are not real data things and a single prefix for a namespace will always work, even when multiple are originally supplied in the data, or defined as per your code above.
So I'm not motivated to solve this one. And there is indeed a work around.
If it's really important to you, @hsekol-hub, please feel free to create a Pull Request to address it yourself.
from rdflib.
Related Issues (20)
- HextuplesParser could/should use json.loads with strict=False
- regenerate _DOAP.py HOT 3
- JSON-LD serialization apparently loses XSD type information. HOT 4
- TypeError: Param.postParse2() missing 1 required positional argument: 'tokenList' when executing a SPARQL query with RDFLib 7.0 HOT 1
- Document RDFLib and pyld usage patterns HOT 1
- fails to serialize graphs containing some IRIs to xml HOT 2
- Issues with negative dates HOT 5
- owl:qualifiedCardinality support lacked HOT 1
- The case for removing poetry.lock? HOT 2
- Make dependabot updates to a different target-branch HOT 1
- Force a specific version of `black` in format checking HOT 5
- Add an unbind method on Graph and Namespace Manager to unbind prefixes
- Add xsd:duration sparql functionality HOT 2
- [DISCUSSION] Reasons to keep URIRef, BlankNode, and Literal as subclasses of `str`? HOT 5
- remote sparql queries always use POST HOT 1
- add more sorting options in longturtle serializer HOT 2
- Improve documentation of command-line tools
- Lacking plugin for sparql query results of format application/json HOT 2
- AttributeError: property 'name' of 'Param' object has no setter
- [PROPOSAL] New Parser and Serializer interface HOT 7
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.