commit 11aedc15e2dede14df11d4a1a370cdd3fc9bfe53
parent c96aa1eac19ac96406feb1147884763bb50f0042
Author: lash <dev@holbrook.no>
Date: Sun, 6 Sep 2026 10:35:13 -0600
Explode ns to module folder
Diffstat:
8 files changed, 85 insertions(+), 73 deletions(-)
diff --git a/adesse/config.py b/adesse/config.py
@@ -1,13 +1,5 @@
import os
-namespace_sources = {
- 'DF': 'http://defalsify.org/rdf/0.1/core/',
- 'COUNTRY': 'http://www.iso.org/obp/ui/#iso:code:3166:',
- 'MIME': 'http://www.iana.org/assignments/media-types/',
- 'PSS': 'http://standards.internetofproduction.org/pub/r7g0n9fo/release/4#',
- 'WOT': 'http://xmlns.com/wot/0.1/#',
- }
-
serialize_format = os.environ.get('ADESSE_FORMAT', 'xml')
base = 'URN:uuid:'
diff --git a/adesse/ns.py b/adesse/ns.py
@@ -1,63 +0,0 @@
-from rdflib.namespace import Namespace, DefinedNamespace
-from rdflib.term import URIRef
-
-from .config import namespace_sources as ns
-
-UU = Namespace('URN:uuid:')
-
-COUNTRY = Namespace(ns['COUNTRY'])
-
-SHA256 = Namespace('URN:sha256:')
-
-MIME = Namespace(ns['MIME'])
-
-class DF(DefinedNamespace):
- subject: URIRef
- object: URIRef
- agent: URIRef
- perceivedThrough: URIRef
- perceivedTime: URIRef
- hasIdentity: URIRef
- verdict: URIRef
- hasClaim: URIRef
- testimonyFor: URIRef
- sum: URIRef
-
- # classes
- Event: URIRef
- AttachmentData: URIRef
- Testimony: URIRef
- Certificate: URIRef
- Action: URIRef
-
- # perceptionmedium
- video: URIRef
- audio: URIRef
- text: URIRef
- presence: URIRef
- realtime: URIRef
-
- # results
- certified: URIRef
-
- _NS = Namespace(ns['DF'])
-
-
-class PSS(DefinedNamespace):
-
- topic: URIRef
- nationality: URIRef
- residenceCountry: URIRef
-
- Person: URIRef
-
- PRINT3D: URIRef
-
- _NS = Namespace(ns['PSS'])
-
-
-class WOT(DefinedNamespace):
-
- PubKey: URIRef
-
- _NS = Namespace(ns['WOT'])
diff --git a/adesse/ns/__init__.py b/adesse/ns/__init__.py
@@ -0,0 +1,9 @@
+#from rdflib.namespace import Namespace, DefinedNamespace
+#from rdflib.term import URIRef
+
+#from .config import namespace_sources as ns
+
+from .inc import *
+from .wot import WOT
+from .df import DF
+from .pss import PSS
diff --git a/adesse/ns/df.py b/adesse/ns/df.py
@@ -0,0 +1,34 @@
+from .inc import *
+
+class DF(DefinedNamespace):
+ subject: URIRef
+ object: URIRef
+ agent: URIRef
+ perceivedThrough: URIRef
+ perceivedTime: URIRef
+ hasIdentity: URIRef
+ verdict: URIRef
+ hasClaim: URIRef
+ testimonyFor: URIRef
+ sum: URIRef
+
+ # classes
+ Event: URIRef
+ AttachmentData: URIRef
+ Testimony: URIRef
+ Certificate: URIRef
+ Action: URIRef
+
+ # perceptionmedium
+ video: URIRef
+ audio: URIRef
+ text: URIRef
+ presence: URIRef
+ realtime: URIRef
+
+ # results
+ certified: URIRef
+
+ _NS = Namespace(ns['DF'])
+
+
diff --git a/adesse/ns/inc.py b/adesse/ns/inc.py
@@ -0,0 +1,15 @@
+from rdflib.namespace import Namespace, DefinedNamespace
+from rdflib.term import URIRef
+
+ns = {
+ 'DF': 'http://defalsify.org/rdf/0.1/core/',
+ 'COUNTRY': 'http://www.iso.org/obp/ui/#iso:code:3166:',
+ 'MIME': 'http://www.iana.org/assignments/media-types/',
+ 'PSS': 'http://standards.internetofproduction.org/pub/r7g0n9fo/release/4#',
+ 'WOT': 'http://xmlns.com/wot/0.1/#',
+ }
+
+UU = Namespace('URN:uuid:')
+COUNTRY = Namespace(ns['COUNTRY'])
+SHA256 = Namespace('URN:sha256:')
+MIME = Namespace(ns['MIME'])
diff --git a/adesse/ns/pss.py b/adesse/ns/pss.py
@@ -0,0 +1,16 @@
+from .inc import *
+
+
+class PSS(DefinedNamespace):
+
+ topic: URIRef
+ nationality: URIRef
+ residenceCountry: URIRef
+
+ Person: URIRef
+
+ PRINT3D: URIRef
+
+ _NS = Namespace(ns['PSS'])
+
+
diff --git a/adesse/ns/wot.py b/adesse/ns/wot.py
@@ -0,0 +1,7 @@
+from .inc import *
+
+class WOT(DefinedNamespace):
+
+ PubKey: URIRef
+
+ _NS = Namespace(ns['WOT'])
diff --git a/pyproject.toml b/pyproject.toml
@@ -5,13 +5,15 @@ build-backend = "setuptools.build_meta"
[project]
name = "adesse"
version = "0.0.1"
-description = "Signed "
+description = "Signed testimonials for certifications."
requires-python = ">=3.8"
dependencies = [
"lxml~=6.0.1",
"rdflib~=7.2.1",
"iso3166~=2.1.1",
"python-mimeparse~=2.0.0",
+ "pyld~=2.0.4",
+ "py-multibase~=1.0.3",
]
[project.scripts]
@@ -19,7 +21,7 @@ ungana = "adesse.runnable.cmd:main"
[tool.setuptools.packages.find]
where = ["."]
-include = ["adresse*"]
+include = ["adesse*"]
[tool.setuptools.package-data]
ungana = [