finished ::id & ::attachment

This commit is contained in:
Michael Jerger 2023-07-24 09:05:50 +02:00
parent e70edd2f9c
commit 44862216eb
4 changed files with 104 additions and 11 deletions

View file

@ -1,6 +1,18 @@
- [receipts to transform ttl to spec](#receipts-to-transform-ttl-to-spec)
- [**a**](#a)
- [**rdfs:range**](#rdfsrange)
- [**rdfs:domain**](#rdfsdomain)
- [owner is **a** type](#owner-is-a-type)
- [owner is a **owl:unionOf** types](#owner-is-a-owlunionof-types)
- [Further infos](#further-infos)
- [RDF/S](#rdfs)
- [range (https://www.w3.org/TR/rdf12-schema/#ch\_range)](#range-httpswwww3orgtrrdf12-schemach_range)
- [type (https://www.w3.org/TR/rdf12-schema/#ch\_type)](#type-httpswwww3orgtrrdf12-schemach_type)
# receipts to transform ttl to spec # receipts to transform ttl to spec
## *it* **a** *something* ## **a**
*it* is **a** *something* *it* is **a** *something*
@ -28,6 +40,66 @@ Der token `a` in einer ttl Definition entspricht dem RDF-Prädikat `rdf:type`. S
Das bedeutet für das Tripel: `(R, rdf:type, C) => C instanceof rdfs:Class & R instanceof C` Das bedeutet für das Tripel: `(R, rdf:type, C) => C instanceof rdfs:Class & R instanceof C`
## **rdfs:range**
*its* value is defined in a **rdfs:range** *the range*
If range links to an other definition we map range same as **a**.
Example:
```ttl
as:id rdfs:range xsd:anyURI ;
```
Maps to
```clojure
(s/def ::anyURI p/uri-string?)
(s/def ::id
(s/and
...
::anyURI))
```
## **rdfs:domain**
*it* belong to a **rdfs:domain** *owner*
### owner is **a** type
It is added to the owner. That's the way to model properties. If the owner is membe of an other namespace, we create a subclass with same name in the namespce in scope and enhance the subclass.
Example in namespace activitypub2
```ttl
as:id rdfs:domain [a owl:Class;]
```
Maps to
```clojure
(s/def
::Class
(s/merge ::owl/Class
(s/keys :opt-un [::id])))
```
### owner is a **owl:unionOf** types
It is added to the owner. That's the way to model properties. If the owner is membe of an other namespace, we create a subclass with same name in the namespce in scope and enhance the subclass.
Example in namespace activitypub2
```ttl
as:id rdfs:domain [owl:unionOf (as:Link as:Object)]
```
Maps to
```clojure
(s/def ::Object (s/keys :opt-un [::id ...]))
(s/def ::Link (s/keys :opt-un [::id]))
```
# Further infos # Further infos
## RDF/S ## RDF/S

View file

@ -18,25 +18,43 @@
::xsd/anyURI)) ::xsd/anyURI))
;http://www.w3.org/ns/activitystreams#attachment ;http://www.w3.org/ns/activitystreams#attachment
;TODO: definition in progress
(s/def ::attachment (s/def ::attachment
(s/and ::owl/ObjectProperty)) (s/and
::Class
::Link
::Object
::owl/ObjectProperty))
;http://www.w3.org/ns/activitystreams#result ;http://www.w3.org/ns/activitystreams#result
;TODO: definition in progress ;TODO: definition in progress
;How should we translate this?
;rdfs:range [
; a owl:Class ;
; owl:unionOf ( as:Object as:Link )
; ]
(s/def ::result (s/def ::result
(s/and ::owl/ObjectProperty)) (s/and ::owl/ObjectProperty))
;http://www.w3.org/ns/activitystreams#Object
;TODO: definition in progress
(s/def ::Object (s/keys :opt-un [::attachment]))
;http://www.w3.org/ns/activitystreams#Activity ;http://www.w3.org/ns/activitystreams#Activity
;TODO: definition in progress ;TODO: definition in progress
(s/def ::Activity (s/def ::Activity
(s/and ::Object (s/and ::Object
(s/keys :opt-un [::result]))) (s/keys :opt-un [::result])))
;http://www.w3.org/ns/activitystreams#Object
;TODO: definition in progress
(s/def ::Object (s/keys :opt-un [::id ::attachment]))
;http://www.w3.org/ns/activitystreams#Link
;TODO: definition in progress
(s/def ::Link (s/keys :opt-un [::id]))
(s/def
::Class
(s/merge ::owl/Class
(s/keys :opt-un [::id])))
;http://www.w3.org/ns/activitystreams#Like ;http://www.w3.org/ns/activitystreams#Like
(s/def ::Like ::Activity) (s/def ::Like ::Activity)

View file

@ -9,6 +9,10 @@
; * Datatype properties link individuals to data values. ; * Datatype properties link individuals to data values.
; * Object properties link individuals to individuals. ; * Object properties link individuals to individuals.
;http://www.w3.org/2002/07/owl#Class
;https://www.w3.org/TR/owl-ref/#Class-def
(s/def ::Class any?)
;http://www.w3.org/2002/07/owl#DatatypeProperty ;http://www.w3.org/2002/07/owl#DatatypeProperty
(s/def ::DatatypeProperty any?) (s/def ::DatatypeProperty any?)

View file

@ -1,6 +1,5 @@
(ns org.domaindrivenarchitecture.activity-pub-poc.xsd (ns org.domaindrivenarchitecture.activity-pub-poc.xsd
"A swallow spec translation implementation of xsd Inheritance of FunctionalProperty "A spec translation implementation of xsd. Predicates are implemented fully functional."
is realized in deep implemented."
(:require [clojure.spec.alpha :as s] (:require [clojure.spec.alpha :as s]
[org.domaindrivenarchitecture.activity-pub-poc.predicates :as p])) [org.domaindrivenarchitecture.activity-pub-poc.predicates :as p]))