We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello! I wrote some code that iterates through a CSV which has RDF in it like the following:
cco:Person1 , rdf:type , cco:Person cco:Person1 rdfs:label , John
But I can't bind my user defined namespace (cco) in the graph. I've tried something like this:
g.bind('cco',cco)
And this:
g.bind('http://www.ontologyrepository.com/CommonCoreOntologies/',cco)
But neither works. Instead, ns1 is bound simply as cco and ns2 is rdfs How can I bind user-defined prefixes in a graph that don't resort to ns1 ns2?
ns1
cco
ns2
rdfs
The text was updated successfully, but these errors were encountered:
This worked for me:
from rdflib import * cco = Namespace("http://www.ontologyrepository.com/CommonCoreOntologies/") g = Graph() g.add((cco.A, BNode(), BNode())) g.bind("cco", cco) print(g.serialize()) #@prefix cco: <http://www.ontologyrepository.com/CommonCoreOntologies/> . #cco:A [ ] [ ] .
Sorry, something went wrong.
No branches or pull requests
Hello! I wrote some code that iterates through a CSV which has RDF in it like the following:
But I can't bind my user defined namespace (cco) in the graph. I've tried something like this:
And this:
But neither works. Instead,
ns1
is bound simply ascco
andns2
isrdfs
How can I bind user-defined prefixes in a graph that don't resort to ns1 ns2?
The text was updated successfully, but these errors were encountered: