Skip to content

Commit 9c71317

Browse files
committed
[doc/rdf] Custom RDF subclassing
1 parent ef4f84e commit 9c71317

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

doc/odmltordf.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,21 @@ Currently the following mappings of ``odml.Section.type`` values to odml-rdf:Sec
214214
stimulus/white_noise: Whitenoise
215215
subject: Subject
216216

217+
Custom RDF subclassing
218+
----------------------
219+
220+
The default list of odml.Section.types can be supplemented or even replaced by custom type to RDF subclass mappings.
221+
222+
All required is to provide a dictionary of the format ``{"odml.Section.type value": "RDF subclass value"}``. Please note that the ``odml.Section.type`` value should be provided lower case, while the ``RDF subclass value`` should be provided upper case::
223+
224+
custom_class_dict = {"species": "Species", "cell": "Neuron"}
225+
rdf_export = RDFWriter(doc, custom_subclasses=custom_class_dict)
226+
227+
Please note that entries in a custom subclass dictionary will overwrite entries in the default subclass dictionary.
228+
229+
Disable RDF subclassing
230+
-----------------------
231+
The subclassing feature can be disabled to export all odml.Sections as plain odml-rdf:Sections instead. This might be necessary if for e.g. a graph database is used that does not provide proper SPARQL reasoning and cannot make sense of RDF subclasses::
232+
233+
rdf_export = RDFWriter(doc, rdf_subclassing=False)
234+

0 commit comments

Comments
 (0)