Phriction Projects Wikis Der Späte Nietzsche Data Collection Workflow For SpN Howto Create owl:Ontology From Python Classes and Convert Data To RDF History Version 1 vs 2
Version 1 vs 2
Version 1 vs 2
Content Changes
Content Changes
# Create owl:Ontology from python classes and convert data to rdf turtle file
Repository: [[https://c4science.ch/source/nietzsche-python/|nietzsche-python]]
## In one step:
```
$ python3 py2ttl/convert.py <MANUSCRIPT.xml>
```
<MANUSCRIPT.xml> is a manuscript xml file.
Script will save ontology to a file 'PROJECT_PREFIX-ontology_autogenerated.ttl'.
Script will convert xml data to rdf triples and write them to a file 'MANUSCRIPTTITLE_//DATA//.ttl'.
## In two steps:
1. Create ontology file:
```
$ python3 py2ttl/py2ttl_ontology.py
```
Script will save ontology to a file 'PROJECT_PREFIX-ontology_autogenerated.ttl'. It will also create a mapping dictionary file that
contains a mapping for each python class to the URIRef of the ontology. This file will be named 'mapping_file4DATATYPEPACKAGE2ONTOLOGYFILE.xml',
where DATATYPEPACKAGE refers to the package of the datatypes (i.e. 'svgscripts.datatypes') and ONTOLOGYFILE refers to the autogenerated ontology file.
Use option `--target=target_ontology_file` to change output file name for the ontology.
2. Convert data to rdf triples and store as turtle file:
```
$ python3 py2ttl/py2ttl_data.py <MANUSCRIPT.xml>
```
<MANUSCRIPT.xml> is a manuscript xml file.
Script will convert xml data to rdf triples and write them to a file 'MANUSCRIPTTITLE_//DATA//.ttl'.
Use option `--mapping=mapping_dict.xml` to specify your mapping dictionary xml file.
# Create owl:Ontology from python classes and convert data to rdf turtle file
Repository: [[https://c4science.ch/source/nietzsche-python/|nietzsche-python]]
## In one step:
```
$ python3 py2ttl/convert.py <MANUSCRIPT.xml>
```
<MANUSCRIPT.xml> is a manuscript xml file.
Script will save ontology to a file 'PROJECT_PREFIX-ontology_autogenerated.ttl'.
Script will convert xml data to rdf triples and write them to a file 'MANUSCRIPTTITLE_//DATA//.ttl'.
## In two steps:
###1. Create ontology file:
```
$ python3 py2ttl/py2ttl_ontology.py
```
Script will save ontology to a file 'PROJECT_PREFIX-ontology_autogenerated.ttl'. It will also create a mapping dictionary file that
contains a mapping for each python class to the URIRef of the ontology. This file will be named 'mapping_file4DATATYPEPACKAGE2ONTOLOGYFILE.xml',
where DATATYPEPACKAGE refers to the package of the datatypes (i.e. 'svgscripts.datatypes') and ONTOLOGYFILE refers to the autogenerated ontology file.
Use option `--target=target_ontology_file` to change output file name for the ontology.
###2. Convert data to rdf triples and store as turtle file:
```
$ python3 py2ttl/py2ttl_data.py <MANUSCRIPT.xml>
```
<MANUSCRIPT.xml> is a manuscript xml file.
Script will convert xml data to rdf triples and write them to a file 'MANUSCRIPTTITLE_//DATA//.ttl'.
Use option `--mapping=mapping_dict.xml` to specify your mapping dictionary xml file.
# Create owl:Ontology from python classes and convert data to rdf turtle file
Repository: [[https://c4science.ch/source/nietzsche-python/|nietzsche-python]]
## In one step:
```
$ python3 py2ttl/convert.py <MANUSCRIPT.xml>
```
<MANUSCRIPT.xml> is a manuscript xml file.
Script will save ontology to a file 'PROJECT_PREFIX-ontology_autogenerated.ttl'.
Script will convert xml data to rdf triples and write them to a file 'MANUSCRIPTTITLE_//DATA//.ttl'.
## In two steps:
###1. Create ontology file:
```
$ python3 py2ttl/py2ttl_ontology.py
```
Script will save ontology to a file 'PROJECT_PREFIX-ontology_autogenerated.ttl'. It will also create a mapping dictionary file that
contains a mapping for each python class to the URIRef of the ontology. This file will be named 'mapping_file4DATATYPEPACKAGE2ONTOLOGYFILE.xml',
where DATATYPEPACKAGE refers to the package of the datatypes (i.e. 'svgscripts.datatypes') and ONTOLOGYFILE refers to the autogenerated ontology file.
Use option `--target=target_ontology_file` to change output file name for the ontology.
###2. Convert data to rdf triples and store as turtle file:
```
$ python3 py2ttl/py2ttl_data.py <MANUSCRIPT.xml>
```
<MANUSCRIPT.xml> is a manuscript xml file.
Script will convert xml data to rdf triples and write them to a file 'MANUSCRIPTTITLE_//DATA//.ttl'.
Use option `--mapping=mapping_dict.xml` to specify your mapping dictionary xml file.
c4science · Help