aboutsummaryrefslogtreecommitdiffstats
path: root/bsfs/schema/serialize.py
diff options
context:
space:
mode:
Diffstat (limited to 'bsfs/schema/serialize.py')
-rw-r--r--bsfs/schema/serialize.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/bsfs/schema/serialize.py b/bsfs/schema/serialize.py
index acc009a..ea8b2f4 100644
--- a/bsfs/schema/serialize.py
+++ b/bsfs/schema/serialize.py
@@ -1,9 +1,4 @@
-"""
-Part of the BlackStar filesystem (bsfs) module.
-A copy of the license is provided with the project.
-Author: Matthias Baumgartner, 2022
-"""
# standard imports
import itertools
import typing
@@ -246,13 +241,14 @@ def to_string(schema_inst: schema.Schema, fmt: str = 'turtle') -> str:
graph.add(triple)
# add known namespaces for readability
# FIXME: more generically?
- graph.bind('bse', rdflib.URIRef(ns.bse['']))
- graph.bind('bsfs', rdflib.URIRef(ns.bsfs['']))
- graph.bind('bsm', rdflib.URIRef(ns.bsm['']))
- graph.bind('rdf', rdflib.URIRef(ns.rdf['']))
- graph.bind('rdfs', rdflib.URIRef(ns.rdfs['']))
- graph.bind('schema', rdflib.URIRef(ns.schema['']))
- graph.bind('xsd', rdflib.URIRef(ns.xsd['']))
+ graph.bind('bsfs', rdflib.URIRef(ns.bsfs + '/'))
+ graph.bind('bsl', rdflib.URIRef(ns.bsl + '/'))
+ graph.bind('bsn', rdflib.URIRef(ns.bsn + '#'))
+ graph.bind('bse', rdflib.URIRef(ns.bsfs.Entity() + '#'))
+ graph.bind('rdf', rdflib.URIRef(ns.rdf))
+ graph.bind('rdfs', rdflib.URIRef(ns.rdfs))
+ graph.bind('schema', rdflib.URIRef(ns.schema))
+ graph.bind('xsd', rdflib.URIRef(ns.xsd))
# serialize to turtle
return graph.serialize(format=fmt)