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
Searches within odML documents are part of the library implementation and imports from linked, external sources into odML documents can be easily done with the core library functionality.
9
9
With the option to export odML documents to the RDF format, users also gain the option to search across multiple documents using tools from the Semantic Web technology.
@@ -12,16 +12,13 @@ If you are unfamiliar with it, we linked additional information to the `Semantic
12
12
13
13
RDF was designed by the World Wide Web Consortium (W3C) as a standard model for data representation and exchange on the web with the heterogeneity of data in mind. Even tough the RDF file format might vary, the underlying concept features two key points. The first is that information is structured in subject-predicate-object triples e.g. "apple hasColor red". The second key point is that multiple subjects and objects can be connected to form a graph e.g. "tree hasFruit apple" can be combined with the previous example to form a minimal graph. These graphs can contain very heterogeneous data, but can still be queried due to the semantic structure of the underlying data.
14
14
15
-
odML to RDF usage
16
-
=================
15
+
odML to RDF export
16
+
==================
17
17
18
18
Without further ado the next sections will expose you to the range of odML to RDF features the core library provides.
19
19
20
-
Saving an odML document to an RDF format file
21
-
---------------------------------------------
22
-
23
-
Using odml.save to export to default XML RDF
24
-
********************************************
20
+
Default odML to XML RDF export
21
+
------------------------------
25
22
26
23
Once an odML document is available, it can most easily be exported to RDF by the odml.save feature.
27
24
@@ -62,16 +59,17 @@ The content of the file will look something like this (the UUIDs of the individu
62
59
</rdf:Description>
63
60
</rdf:RDF>
64
61
65
-
Using the RDFWriter class to export to a specific RDF format
``turtle`` is the format that is best suited for storage and human readability which is why we will use it in our tutorial. For cross-tool usage, saving RDF in its ``XML`` variant is probably the safest choice.
70
+
``turtle`` is the format that is best suited for storage and human readability while for cross-tool usage, saving RDF in its ``XML`` variant is probably the safest choice.
73
71
74
-
The output can also be returned as a string instead of saving it to a file::
72
+
The exported output can be returned as a string::
75
73
76
74
from odml.tools.rdf_converter import RDFWriter
77
75
@@ -95,10 +93,21 @@ This will print the content of the odML document in the Turtle flavor of RDF::
The output can of course also be written to a file with a specified RDF output format; the output file will autmatically be assigned the appropriate file ending.::
96
+
The output can of course also be written to a file with a specified RDF output format; the output file will autmatically be assigned the appropriate file ending::
All available RDF output formats can be viewed via ``odml.tools.parser_utils.RDF_CONVERSION_FORMATS.keys()``.
103
+
104
+
Bulk export to XML RDF
105
+
----------------------
106
+
107
+
Existing odML files can be exported to XML RDF in bulk using the ``odmltordf`` command line tool that is automatically installed with the core library.
108
+
109
+
odmlToRDF searches for odML files within a provided SEARCHDIR and converts them to the newest odML format version and exports all found and resulting odML files to XML formatted RDF. Original files will never be overwritten. New files will be written either to a new directory at the current or a specified location.
110
+
111
+
Usage: odmltordf [-r] [-o OUT] SEARCHDIR
112
+
113
+
The command line option ``-r`` enables recursive search, ``-o OUT`` specifies a dedicated output folder for the created output files.
0 commit comments