-
Notifications
You must be signed in to change notification settings - Fork 579
Open
Labels
questionFurther information is requestedFurther information is requested
Description
I have the following code snippet...
With it I separate and later put together a ttl again.
graph = Graph()
for file in os.listdir(PATH):
if file.endswith(".ttl"):
graph.parse(os.path.join(PATH, file))
graph_class = Graph()
graph_properties = Graph()
graph_class += graph.triples((None, RDF.type, OWL.Class))
graph_properties += graph.triples((None, RDF.type, OWL.ObjectProperty))
graph_full = graph_class + graph_properties
I keep looking at the code and I don't like the aesthetics very much.
Is there any other way to do this, that is, build a graph with only the existing classes and properties in the original?
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested