diff options
author | Matthias Baumgartner <dev@igsor.net> | 2023-03-05 19:25:17 +0100 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2023-03-05 19:25:17 +0100 |
commit | e4845c627e97a6d125bf33d9e7a4a8d373d7fc4a (patch) | |
tree | 634198c34aae3c0306ce30ac7452abd7b53a14e8 /bsfs/schema/serialize.py | |
parent | 9b490d19dcebc0fc24cb2ab89a783f1f7d6147f7 (diff) | |
parent | 3ae93a405724ca6b5ddeb0b458fcc95685f83f09 (diff) | |
download | bsfs-e4845c627e97a6d125bf33d9e7a4a8d373d7fc4a.tar.gz bsfs-e4845c627e97a6d125bf33d9e7a4a8d373d7fc4a.tar.bz2 bsfs-e4845c627e97a6d125bf33d9e7a4a8d373d7fc4a.zip |
Merge branch 'mb/diogenes' into develop
Diffstat (limited to 'bsfs/schema/serialize.py')
-rw-r--r-- | bsfs/schema/serialize.py | 20 |
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) |