Comments (3)
But in Turtle syntax the rdfs:
translates to a valid URI.
I don't think there is a way to unbind a prefix from the NamespaceManager, which automatically binds some 'core prefixes':
rdflib/rdflib/namespace/__init__.py
Lines 463 to 464 in ce7e414
Either pick a different serialization format (e.g. nt), or write your own custom NamespaceManager. But keep in mind that the rdfs:
bit is valid RDF.
from rdflib.
Is this what you want?
from rdflib import Graph, URIRef, Literal, RDF, OWL, DC
graph = Graph()
graph.namespace_manager.bind("rdfs", None, replace=True)
rdfs = URIRef("http://www.w3.org/2000/01/rdf-schema#")
graph.add((
rdfs, RDF.type, OWL.Ontology
))
graph.add((
rdfs, DC.title, Literal("The RDF Schema vocabulary (RDFS)")
))
graph.print()
Output:
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
<http://www.w3.org/2000/01/rdf-schema#> a owl:Ontology ;
dc:title "The RDF Schema vocabulary (RDFS)" .
Looks like binding an existing prefix with None
with the optional replace=True
will "unbind" the prefix.
from rdflib.
from rdflib.
Related Issues (20)
- apidocs/rdflib.extras.html varies between builds HOT 1
- 7.0.0: pytest is failing in 2 units and many pytest warnings HOT 2
- Binding user-defined Namespace HOT 1
- Unable to embed rdflib in a python extension
- Bug when using FROM statements HOT 4
- Bug: Comparison and arithmetic on xsd:duration HOT 1
- SPARQL Subquey parse error HOT 5
- typo in Container method name: type_of_conatiner --> type_of_container
- Turning rdflib jsonld into a "full processor" (a.o. for schema.org compliance) HOT 3
- Incorrect working when deleting triplets in a BerkeleyDB store HOT 1
- Graph.parse: Guess format when remote source content type is "text/plain"
- Optional skolemize blank nodes on parse HOT 3
- json-ld serialize doesnt failt or raise warning, when producing invalid syntax; type is literal HOT 7
- FAILED test/test_misc/test_parse_file_guess_format.py::TestFileParserGuessFormat::test_warning HOT 2
- RFE: move away from deprecated `html5lib` HOT 1
- BUG : jsonld parser does not randomise bnodes when using local _prefixed identifiers `"@id": "_:mybnode01"` HOT 1
- Adding a value as a list to the graph HOT 4
- Bug in `longturtle` serialization HOT 2
- Rdflib 7.0.0: Inadequate Support for Importing Multiple Prefixes with the Same IRI and Base IRI HOT 2
- Unexpected recursive context inclusion exception HOT 2
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.