You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This problem seems like it might be related to #1997, but is different inasmuch as it is affected by serialization step of a parsed graph, rather than the parsing step.
I have an RDF file (in RDF/XML format, and a *.owl filename extension in case that matters) with several prefixes defined at the beginning. All of the prefixes are preserved in the result of:
from rdflib import Graph
g = Graph().parse("myfile.owl")
list(g.namespaces)
If I serialize via `g.serialize(format="xml") then some of the prefixes are lost - it looks like any prefixes that aren't actually used in the input RDF are dropped, which is surprising (after parsing, does the Graph object retain that information?). The presence of the mapped namespaces in URIs used in the RDF does not seem to matter (i.e., those namespaces are found in some of the URIs in the content).
If I serialize via `g.serialize(format="turtle") then my original prefixes are preserved. Yay, but... eh?
The text was updated successfully, but these errors were encountered:
aucampia
added
the
core
Relates to core functionality of RDFLib, i.e. `rdflib.{graph,store,term}`
label
May 11, 2023
rdflib
version 6.3.2 (latest)This problem seems like it might be related to #1997, but is different inasmuch as it is affected by serialization step of a parsed graph, rather than the parsing step.
I have an RDF file (in RDF/XML format, and a *.owl filename extension in case that matters) with several prefixes defined at the beginning. All of the prefixes are preserved in the result of:
If I serialize via `g.serialize(format="xml") then some of the prefixes are lost - it looks like any prefixes that aren't actually used in the input RDF are dropped, which is surprising (after parsing, does the Graph object retain that information?). The presence of the mapped namespaces in URIs used in the RDF does not seem to matter (i.e., those namespaces are found in some of the URIs in the content).
If I serialize via `g.serialize(format="turtle") then my original prefixes are preserved. Yay, but... eh?
The text was updated successfully, but these errors were encountered: