Skip to content

Commit ef4f84e

Browse files
committed
[doc/rdf] RDF subclassing
1 parent b4e174e commit ef4f84e

File tree

1 file changed

+103
-0
lines changed

1 file changed

+103
-0
lines changed

doc/odmltordf.rst

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,106 @@ odmlToRDF searches for odML files within a provided SEARCHDIR and converts them
111111
Usage: odmltordf [-r] [-o OUT] SEARCHDIR
112112

113113
The command line option ``-r`` enables recursive search, ``-o OUT`` specifies a dedicated output folder for the created output files.
114+
115+
116+
Advanced features
117+
=================
118+
119+
RDF subclassing of odml.Section.type
120+
------------------------------------
121+
122+
By default a set of pre-defined odml.Section.types will export Sections not as an odml:Section but as a specific RDF subclass of an odml:Section. This is meant to simplify SPARQL query searches on graph databases that contain odml specific RDF.
123+
124+
As an example an odml.Section normally gets exported as RDF class type odml-rdf:Section::
125+
126+
<rdf:type rdf:resource="https://g-node.org/odml-rdf#Section"/>
127+
128+
An odml.Section with the odml.Section.type="protocol" will by default be exported as a different RDF class type::
129+
130+
<rdf:type rdf:resource="https://g-node.org/odml-rdf#Protocol"/>
131+
132+
In an RDF query this can now be searched for directly by asking for RDF class "odml-rdf:Protocol" instead of asking for RDF class "odml-rdf:Section" with type "Protocol".
133+
134+
On install the core library already provides a list of odml.Section.type mappings to RDF subclasses. On initialisation the ``RDFWriter`` loads all subclasses that are available and uses them by default when exporting an odML document to RDF. The available terms and the mappings of odml.Section.types to RDF subclasses can be viewed by accessing the ``section_subclasses`` attribute of an initialised ``RDFWriter``::
135+
136+
rdf_export = RDFWriter(doc)
137+
rdf_export.section_subclasses
138+
139+
This export also adds all used subclass definitions to the resulting file to enable query reasoners to makes sense of the introduced subclasses upon a query.
140+
141+
Currently the following mappings of ``odml.Section.type`` values to odml-rdf:Section subclass are available::
142+
143+
analysis: Analysis
144+
analysis/power_spectrum: PowerSpectrum
145+
analysis/psth: PSTH
146+
cell: Cell
147+
datacite/alternate_identifier: AlternateIdentifier
148+
datacite/contributor: Contributer
149+
datacite/contributor/affiliation: Affiliation
150+
datacite/contributor/named_identifier: NamedIdentifier
151+
datacite/creator: Creator
152+
datacite/creator/affiliation: Affiliation
153+
datacite/creator/named_identifier: NamedIdentifier
154+
datacite/date: Date
155+
datacite/description: Description
156+
datacite/format: Format
157+
datacite/funding_reference: FundingReference
158+
datacite/geo_location: GeoLocation
159+
datacite/identifier: Identifier
160+
datacite/related_identifier: RelatedIdentifier
161+
datacite/resource_type: ResourceType
162+
datacite/rights: Rights
163+
datacite/size: Size
164+
datacite/subject: Subject
165+
datacite/title: Title
166+
dataset: Dataset
167+
data_reference: DataReference
168+
blackrock: Blackrock
169+
electrode: Electrode
170+
event: Event
171+
event_list: EventList
172+
experiment: Experiment
173+
experiment/behavior: Behavior
174+
experiment/electrophysiology: Electrophysiology
175+
experiment/imaging: Imaging
176+
experiment/psychophysics: Psychophysics
177+
hardware_properties: HardwareProperties
178+
hardware_settings: HardwareSettings
179+
hardware: Hardware
180+
hardware/amplifier: Amplifier
181+
hardware/attenuator: Attenuator
182+
hardware/camera_objective: CameraObjective
183+
hardware/daq: DataAcquisition
184+
hardware/eyetracker: Eyetracker
185+
hardware/filter: Filter
186+
hardware/filter_set: Filterset
187+
hardware/iaq: ImageAcquisition
188+
hardware/light_source: Lightsource
189+
hardware/microscope: Microscope
190+
hardware/microscope_objective: MicroscopeObjective
191+
hardware/scanner: Scanner
192+
hardware/stimulus_isolator: StimulusIsolator
193+
model/lif: LeakyIntegrateAndFire
194+
model/pif: PerfectIntegrateAndFire
195+
model/multi_compartment: MultiCompartmentModel
196+
model/single_compartment: SingleCompartmentModel
197+
person: Person
198+
preparation: Preparation
199+
project: Project
200+
protocol: Protocol
201+
recording: Recording
202+
setup: Setup
203+
stimulus: Stimulus
204+
stimulus/dc: DC
205+
stimulus/gabor: Gabor
206+
stimulus/grating: Grating
207+
stimulus/pulse: Pulse
208+
stimulus/movie: Movie
209+
stimulus/ramp: Ramp
210+
stimulus/random_dot: RandomDot
211+
stimulus/sawtooth: Sawtooth
212+
stimulus/sine_wave: Sinewave
213+
stimulus/square_wave: Squarewave
214+
stimulus/white_noise: Whitenoise
215+
subject: Subject
216+

0 commit comments

Comments
 (0)