Skip to content

Commit

Permalink
added version in URI namespace for RDF
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Nov 10, 2021
1 parent e4c36d4 commit 70ec145
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions foliatools/foliaspec2rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,18 @@ def main():
elements, elementdict, parents = getelements(spec) #gathers all class names
elements.sort(key=lambda x: x['class'])

majorversion = spec['version'].split(".")[0]

print(\
f"""@prefix folia: <{spec['namespace']}#> .
f"""@prefix folia: <{spec['namespace']}/v{majorversion}#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xs: <http://www.w3.org/2001/XMLSchema#> .
@prefix dc: <http://purl.org/dc/elements/1.1/#> .
##### FoLiA version v{spec['version']} Specification #######
### Concept Schemes ###
folia:AnnotationTypes a skos:ConceptScheme ;
Expand All @@ -98,7 +102,7 @@ def main():
folia:xmltag a rdf::Property ;
rdfs:domain folia:Element ;
rdfs:range xs:NCName .
folia::annotationtype a rdf::Property ;
folia:annotationtype a rdf::Property ;
rdfs:domain folia:Element ;
rdfs:range folia:AnnotationType .
folia:occurrences a rdf:Property ;
Expand Down

0 comments on commit 70ec145

Please sign in to comment.