Skip to content

Commit

Permalink
rdf namespace: major version only
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Jan 31, 2024
1 parent c7b737a commit 79b9a9b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ vocabulary, even the notion of a word or sentence, comes from a set, as nothing
is predefined at all aside from the STAM model's primitives.

We map most of the vocabulary of FoLiA itself to a STAM dataset with ID
`https://w3id.org/folia/`. All of FoLiA's annotation types, element types, and
`https://w3id.org/folia/v2/`. All of FoLiA's annotation types, element types, and
common attributes are defined in this set.

Each FoLiA set definition maps to a STAM dataset with the same set ID (URI. The
Expand All @@ -205,14 +205,14 @@ attribute. Any FoLiA subsets (for features) also translate to key identifiers.
The declarations inside a FoLiA document will be explicitly expressed in STAM as well;
each STAM dataset will have an annotation that points to it (with a
DataSetSelector). This annotation has data with key `declaration` (set
`https://w3id.org/folia/`) that marks it as a declaration for a specific type,
`https://w3id.org/folia/v2/`) that marks it as a declaration for a specific type,
the value is something like `pos-annotation` and corresponds one-on-one to the declaration
element used in FoLiA XML. Additionally, this annotation also has data with key
`annotationtype` (same set as above) that where the value corresponds to the
annotation type (lowercased, e.g. `pos`).

The FoLiA to STAM conversion is RDF-ready. That is, all identifiers are valid
IRIs and all FoLiA vocabulary (`https://w3id.org/folia/`) is backed by `a formal ontology <
IRIs and all FoLiA vocabulary (`https://w3id.org/folia/v2/`) is backed by `a formal ontology <
https://github.com/proycon/folia/blob/master/schemas/folia.ttl>`_ using RDF and SKOS.

FoLiA set definitions, if defined, are already in SKOS (or in the legacy
Expand Down
4 changes: 2 additions & 2 deletions foliatools/folia2stam.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import stam

#Namespace for STAM annotationset and for RDF, not the same as XML namepace because that one is very old and hard to resolve
FOLIA_NAMESPACE = "https://w3id.org/folia/"
FOLIA_NAMESPACE = "https://w3id.org/folia/v2/"


def processdir(d, annotationstore: stam.AnnotationStore, **kwargs):
Expand Down Expand Up @@ -62,7 +62,7 @@ def convert(f, annotationstore: stam.AnnotationStore, **kwargs):
"value": value,
"set": FOLIA_NAMESPACE
},
])
]



Expand Down
3 changes: 1 addition & 2 deletions foliatools/foliaspec2rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ def main():
elements.sort(key=lambda x: x['class'])

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

print(\
f"""@prefix folia: <{spec['rdfnamespace']}/{majorversion}.{minorversion}/#> .
f"""@prefix folia: <{spec['rdfnamespace']}/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#> .
Expand Down

0 comments on commit 79b9a9b

Please sign in to comment.