Skip to content

Commit

Permalink
output syntax fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Nov 10, 2021
1 parent 0a0ee10 commit e4c36d4
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions foliatools/foliaspec2rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ def main():
elements.sort(key=lambda x: x['class'])

print(\
f"""
@prefix folia: <{spec['namespace']}#> .
f"""@prefix folia: <{spec['namespace']}#> .
@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#> .
Expand All @@ -80,18 +79,18 @@ def main():
### Concept Schemes ###
folia:AnnotationTypes a skos:ConceptScheme ;
dc:title "FoLiA Annotation Types" .
dc:description "Defines the annotation types of FoLiA, this includes linguistic, structural and markup annotation types"
dc:title "FoLiA Annotation Types" ;
dc:description "Defines the annotation types of FoLiA, this includes linguistic, structural and markup annotation types" .
folia:AnnotationType a rdfs:Class .
folia:Attributes a skos:ConceptScheme ;
dc:title "FoLiA Attributes" .
dc:description "Defines common attributes on FoLiA elements."
dc:title "FoLiA Attributes" ;
dc:description "Defines common attributes on FoLiA elements." .
folia:Attribute a rdfs:Class .
folia:Elements a skos:ConceptScheme ;
dc:title "FoLiA Elements" .
dc:description "Defines FoLiA elements. These correspond to element in FoLiA XML"
dc:title "FoLiA Elements" ;
dc:description "Defines FoLiA elements. These correspond to element in FoLiA XML" .
folia:Element a rdfs:Class .
### Element Properties ###
Expand Down Expand Up @@ -198,6 +197,8 @@ def main():
value = "false"
predicates.append(f"folia:{key} \"{value}\"")
elif key in STRINGPROPERTIES:
if not value: value = ""
value = value.replace("\n","\\n")
predicates.append(f"folia:{key} \"{value}\"")
elif key == 'required_attribs' and value:
assert isinstance(value, list)
Expand Down

0 comments on commit e4c36d4

Please sign in to comment.