Closed noahgorstein closed 1 year ago
When it says “these prefixes are used when serialising RDF, or when parsing SPARQL queries”, it means that prefixes are only used when serializing RDF, or when parsing SPARQL queries.
The predefined prefixes cannot be used when parsing arbitrary RDF-as-turtle because namespace prefixes are a convention and so any prefixes need to be explicitly declared as directives in the source document:
data = """@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
skos:Concept a owl:Class .
"""
ah okay - thanks @gjhiggins !
Hey đź‘‹ ! I'm new to rdflib and think I may have hit a bug. Any help is much appreciated. Apologies in advance if I'm missing something very obvious here.
I am just trying to parse some Turtle without including the namespaces that should be included from the Graph's NamespaceManager. From reading the docs, I thought this was supported but maybe I'm misunderstanding:
Using Python 3.10 with rdflib 6.3.2
Code to reproduce
Output including full traceback: