Skip to content

Commit 143519e

Browse files
committed
[tools/RDFWriter] Add subClassOf usage
Closes #396.
1 parent d15a097 commit 143519e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

odml/tools/rdf_converter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from io import StringIO
1111
from rdflib import Graph, Literal, URIRef
1212
from rdflib.graph import Seq
13-
from rdflib.namespace import XSD, RDF
13+
from rdflib.namespace import XSD, RDF, RDFS
1414

1515
import yaml
1616

@@ -252,6 +252,9 @@ def save_section(self, sec, curr_node):
252252
sub_sec = self._get_section_subclass(sec)
253253
if sub_sec:
254254
curr_type = sub_sec
255+
self.graph.add((URIRef(fmt.rdf_type), RDF.type, RDFS.Class))
256+
self.graph.add((URIRef(curr_type), RDF.type, RDFS.Class))
257+
self.graph.add((URIRef(curr_type), RDFS.subClassOf, URIRef(fmt.rdf_type)))
255258

256259
self.graph.add((curr_node, RDF.type, URIRef(curr_type)))
257260

0 commit comments

Comments
 (0)