Skip to content

Commit ed07bf2

Browse files
authored
Ballot 4 (#166)
# Ballot 4 Consolidation This PR consolidates the Ballot 4 changes from `ballot/4` into `develop`. ## Included PRs (merged into `ballot/4`) - #161 — DPROD-17: add `Retire` to `DataProductLifecycleStatus` (#28) - #162 — DPROD-16: add `dprod-shapes` namespace to normative namespaces (#29) - #163 — DPROD-18: prevent SHACL shape labels leaking into generated spec (#79) - #164 — DPROD-20: correct ODRL modeling in data-rights example (#81, #82, #83) - #168 — DPROD-23: fix `DataProductagreement` typo in examples (#101) - #169 — DPROD-24: fix `Protocol` / `SecuritySchemaType` modeling and `rdfs:label` (#98, #139, #141) - #171 — apply superseding data-rights example variant from original #165 (#83) ## Notes - Original PR #165 was superseded and closed after signature-rule/history conflicts on `joshcornejo-patch-2`. - Replacement PR #171 carries the intended data-rights example update on a clean signed branch. ## Ballot Process Status This PR should remain open until Ballot 4 voting is complete. Do **not** merge into `develop` before vote approval.
2 parents 8ec4bab + bf2eec0 commit ed07bf2

9 files changed

Lines changed: 66 additions & 49 deletions

File tree

examples/core-data-product-extensions/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Below is an example of a Data Product with an associated Data Product Agreement
7878
},
7979
"ex:iSubjectToAgreement": {
8080
"@id": "ex:VVSimpleAgreement",
81-
"@type": "ex:DataProductagreement"
81+
"@type": "ex:DataProductAgreement"
8282
}
8383
}
8484
],

examples/data-rights/README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,21 @@ examplePolicyA odrl:target exampleProduct:ProductA .
1212
examplePolicyB odrl:target exampleDataset:DatasetA1 .
1313
```
1414

15-
An example of a policy follows, that describes permission to distribute the data only within a specific geographic region:
15+
An example of an agreement follows, that describes permission to use all the datasets of the product if the user is working inside EMEA or APAC:
1616

1717
```json
1818
examplePolicyA odrl:permission
1919
{
20-
"action": "odrl:distribute",
21-
"constraint": [
22-
{"leftOperand": "spatial",
23-
"operator": "eq",
24-
"rightOperator": "region:EMEA"
25-
}
26-
]
20+
"action": "odrl:use",
21+
"assignee": {
22+
"@type": "odrl:PartyCollection",
23+
"refinement": [
24+
{"leftOperand": "odrl:spatial",
25+
"operator": "odrl:isAnyOf",
26+
"rightOperand": ["reg:EMEA", "reg:APAC"]
27+
}
28+
]
2729
}
30+
}
2831
```
2932

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
{
2-
"@type": "Offer",
2+
"@type": "Agreement",
33
"@context": [
44
{
55
"odrl": "http://www.w3.org/ns/odrl/2/",
66
"reg": "https://www.region.taxonomy/v/1/"
77
}
88
],
99
"uid": "56456df-dfg-34535345-5545",
10-
"assigner": "https://schema.org/person/AdamSmith",
11-
"target": "https://data.org/data-product/equity-trade-xxx",
1210

1311
"permission": [
1412
{
15-
"action": "odrl:read",
16-
"constraint": [
17-
{
18-
"@type": "odrl:Constraint",
19-
"leftOperand": "odrl:spatial",
20-
"operator": "odrl:isAnyOf",
21-
"rightOperand": [
22-
"reg:EMEA",
23-
"reg:APAC"
24-
],
25-
"description": " Permission to read all the datasets of the product if user is working inside EMEA or APAC"
26-
}
27-
]
13+
"target": "https://data.org/data-product/equity-trade-xxx",
14+
"assigner": "https://schema.org/person/AdamSmith",
15+
"assignee": {
16+
"@type": "PartyCollection",
17+
"source": "https://example.org/DataDepartment",
18+
"refinement": [{
19+
"leftOperand": "odrl:spatial",
20+
"operator": "odrl:isAnyOf",
21+
"rightOperand": [
22+
"reg:EMEA",
23+
"reg:APAC"
24+
],
25+
"description": " Permission to read all the datasets of the product if user is working inside EMEA or APAC"
26+
}]
27+
},
28+
"action": "odrl:use",
2829
}
2930
]
3031
}

ontology/dprod/dprod-ontology.ttl

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ dprod:DataProduct
5454
dprod:DataProductLifecycleStatus
5555
a owl:Class, rdfs:Class ;
5656
dct:description
57-
"The development status of the data product taken from a controlled list (e.g. Ideation, Design, Build, Deploy, Consume)."@en ;
57+
"The development status of the data product taken from a controlled list (e.g. Ideation, Design, Build, Deploy, Consume, Retire)."@en ;
5858
rdfs:comment "The lifecycle of the data product as defined by EDM Council CDMC"@en ;
5959
rdfs:isDefinedBy dprod: ;
6060
rdfs:label "data product lifecycle status" ;
@@ -78,13 +78,6 @@ dprod:Enumeration
7878
rdfs:label "enumeration" ;
7979
.
8080

81-
dprod:Protocol
82-
a owl:Class, rdfs:Class ;
83-
dct:description "A detailed specification, possibly including a specific version, for how to communicate with a service."@en ;
84-
rdfs:isDefinedBy dprod: ;
85-
rdfs:label "protocol" ;
86-
.
87-
8881
dprod:SecuritySchemaType
8982
a owl:Class, rdfs:Class ;
9083
dct:description "A classification encompassing a set of rules used for authentication and communication."@en ;
@@ -211,7 +204,7 @@ dprod:protocol
211204
dct:description "A protocol (possibly one of many options) used to communicate with this data service."@en ;
212205
rdfs:isDefinedBy dprod: ;
213206
rdfs:domain dcat:DataService ;
214-
# rdfs:range rdf:resource ; # better let user decide whether they want Protocol class or own class or skos
207+
# rdfs:range not specified; users reference external URIs or SKOS concepts (DPROD-33)
215208
rdfs:label "protocol" ;
216209
.
217210

@@ -221,5 +214,5 @@ dprod:securitySchemaType
221214
rdfs:isDefinedBy dprod: ;
222215
rdfs:domain dcat:DataService ;
223216
# rdfs:range rdf:resource ; # better let user decide whether they want SecuritySchemaType class or own class or skos
224-
rdf:label "security schema type" ;
217+
rdfs:label "security schema type" ;
225218
.

ontology/dprod/dprod-shapes.ttl

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
1818
@prefix sh: <http://www.w3.org/ns/shacl#> .
1919
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
20-
@prefix sdo: <http://schema.org/> .
2120

2221
dprod-shapes:
2322
a owl:Ontology ;
@@ -125,19 +124,11 @@ dprod-shapes:InformationSensitivityClassificationShape
125124
dprod-shapes:DataProductLifecycleStatusShape
126125
a sh:NodeShape;
127126
rdfs:label "data product lifecycle status shape" ;
128-
dct:description "The development status of the data product taken from a controlled list (e.g. Ideation, Design, Build, Deploy, Consume)."@en ;
127+
dct:description "The development status of the data product taken from a controlled list (e.g. Ideation, Design, Build, Deploy, Consume, Retire)."@en ;
129128
sh:targetClass dprod:DataProductLifecycleStatus;
130129
rdfs:isDefinedBy dprod-shapes:;
131130
.
132131

133-
dprod-shapes:ProtocolShape
134-
a sh:NodeShape;
135-
rdfs:label "protocol shape" ;
136-
dct:description "A detailed specification, possibly including a specific version, for how to communicate with a service."@en ;
137-
rdfs:isDefinedBy dprod-shapes:;
138-
sh:targetClass dprod:Protocol;
139-
.
140-
141132
dprod-shapes:SecuritySchemaTypeShape
142133
a sh:NodeShape;
143134
rdfs:label "security schema type shape" ;
@@ -362,7 +353,6 @@ dprod-shapes:DataService-protocol
362353
a sh:PropertyShape;
363354
rdfs:isDefinedBy dprod-shapes:;
364355
sh:path dprod:protocol;
365-
sh:class dcat:Protocol;
366356
dct:description "A protocol (possibly one of many options) used to communicate with this data service."@en ;
367357
rdfs:label "data service protocol shape" ;
368358
.
@@ -371,7 +361,7 @@ dprod-shapes:DataService-securitySchemaType
371361
a sh:PropertyShape;
372362
rdfs:isDefinedBy dprod-shapes:;
373363
sh:path dprod:securitySchemaType;
374-
sh:class dcat:SecuritySchemaType;
364+
sh:class dprod:SecuritySchemaType;
375365
dct:description "The security schema type used for authentication and communication with this Data Service."@en ;
376366
rdfs:label "data service security schema type shape" ;
377367
.

respec/template.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,15 @@ <h2>Normative namespaces</h2>
596596
</td>
597597
<td>[[dprod]]</td>
598598
</tr>
599+
<tr>
600+
<td>
601+
<code>dprod-shapes</code>
602+
</td>
603+
<td>
604+
<code>https://ekgf.github.io/dprod/shapes/</code>
605+
</td>
606+
<td>[[dprod]]</td>
607+
</tr>
599608
<tr>
600609
<td>
601610
<code>dcat</code>
@@ -807,6 +816,17 @@ <h2>Data Product (DPROD) Model</h2>
807816
{% for cls in classes %}
808817
<section>
809818
<h3 id="{{cls.html_id()}}">{{cls.name}}</h3>
819+
<table class="def classdef">
820+
<tbody>
821+
<tr>
822+
<th>Identifier:</th>
823+
<td>
824+
<!--suppress HtmlUnknownTarget -->
825+
<a href="{{cls.href()}}">{{cls.axiom_iri_normalized}}</a>
826+
</td>
827+
</tr>
828+
</tbody>
829+
</table>
810830
{% if cls.description is not none %}
811831
<p>{{cls.description}}</p>
812832
{% endif %}

spec-generator/globals.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
IGNORED_NODE_SHAPE_PREDICATES = (
1515
RDF.type,
16+
RDFS.label,
1617
RDFS.isDefinedBy,
1718
SKOS.altLabel,
1819
SKOS.changeNote,

spec-generator/main.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ def main():
6565
'Dataset',
6666
'DataProductLifecycleStatus',
6767
'InformationSensitivityClassification',
68-
'Protocol',
6968
'SecuritySchemaType',
7069
'Enumeration'
7170
])

spec-generator/node_shape.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from rdflib import URIRef, Graph, SH, DCTERMS, Literal, RDFS
44

55
from functions import short_name, null_html_string, cast_to_uri_ref
6-
from globals import IGNORED_NODE_SHAPE_PREDICATES, shapes_graph_ns_iri
6+
from globals import IGNORED_NODE_SHAPE_PREDICATES, ontology_namespace_iri, shapes_graph_ns_iri
77

88

99
@dataclass(init=False)
@@ -25,6 +25,7 @@ def __init__(self, g: Graph, **kwargs):
2525
self.axiom_iri = cast_to_uri_ref(g.value(self.shape_iri, SH.targetClass))
2626
if self.axiom_iri is None:
2727
raise ValueError("No sh:axiom_iri provided for NodeShape")
28+
self.axiom_iri_normalized = g.namespace_manager.normalizeUri(self.axiom_iri)
2829
# First load the properties of the OWL target class
2930
for rdf_predicate, rdf_object in g.predicate_objects(self.axiom_iri):
3031
self._set_prop(g, rdf_predicate, rdf_object, 'OWL')
@@ -85,3 +86,12 @@ def html_id(self) -> str | None:
8586
if self.shape_iri.__contains__(shapes_graph_ns_iri):
8687
return self.shape_iri.replace(shapes_graph_ns_iri, '').lower()
8788
return self.name.lower()
89+
90+
def href(self) -> str:
91+
"""Return the href value for the class's canonical identifier.
92+
For DPROD-local classes this points back to the in-page section
93+
(consistent with PropertyShape.href); for external classes such as
94+
dcat:DataService it points to the defining vocabulary."""
95+
if self.axiom_iri.__contains__(ontology_namespace_iri):
96+
return f"#{self.html_id()}"
97+
return str(self.axiom_iri)

0 commit comments

Comments
 (0)