Skip to content

Commit

Permalink
fixes #51 dpv:Concept dfn #52 range unspecified
Browse files Browse the repository at this point in the history
The dpv:Concept definition has been added to DPV spec in a small table
with information on each and a link to serialisations in Appendix.
See #51 for issue and rationale.

Property domain and range, when not declared, are mentioned as "left
blank / unspecified", instead of just "unspecified".
See #52 for discussion and rationale.

Adds skos:broader / skos:narrower relations for DPV (main) spec
concepts. Through this, the DPV spec can be used as a SKOS vocabulary
(including relations, no other semantics).
  • Loading branch information
coolharsh55 committed Sep 27, 2022
1 parent e76a381 commit 4027fbd
Show file tree
Hide file tree
Showing 201 changed files with 156,300 additions and 101,666 deletions.
10 changes: 8 additions & 2 deletions documentation-generator/002_parse_csv_to_rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ def add_triples_for_classes(classes, graph):
graph.add((BASE[f'{cls.term}'], DPV.isInstanceOf, parent))
else:
raise Exception(f'Parent Type Unknown: {cls.parent_type} ')
graph.add((BASE[f'{cls.term}'], SKOS.broader, parent))
graph.add((parent, SKOS.narrower, BASE[f'{cls.term}']))
# rdf:value
if cls.rdf_value:
value, datatype = cls.rdf_value.split(',')
Expand Down Expand Up @@ -256,6 +258,8 @@ def add_triples_for_properties(properties, graph):
for parent in parents:
if parent.startswith('http'):
graph.add((BASE[f'{prop.term}'], DPV.isSubTypeOf, URIRef(parent)))
graph.add((BASE[f'{prop.term}'], SKOS.broader, parent))
graph.add((parent, SKOS.narrower, BASE[f'{prop.term}']))
elif ':' in parent:
if parent == "dpv:Relation":
continue
Expand All @@ -266,6 +270,8 @@ def add_triples_for_properties(properties, graph):
# dpv internal terms are expected to have the prefix i.e. dpv:term
parent = NAMESPACES[prefix][f'{term}']
graph.add((BASE[f'{prop.term}'], DPV.isSubTypeOf, parent))
graph.add((BASE[f'{prop.term}'], SKOS.broader, parent))
graph.add((parent, SKOS.narrower, BASE[f'{prop.term}']))
else:
graph.add((BASE[f'{prop.term}'], DPV.isSubTypeOf, Literal(parent, datatype=XSD.string)))
add_common_triples_for_all_terms(prop, graph)
Expand Down Expand Up @@ -669,8 +675,8 @@ def serialize_graph(graph, filepath):
prefix, parent = item.split(':')
parent = NAMESPACES[prefix][f'{parent}']
graph.add((term, DPV.isSubTypeOf, parent))
# graph.add((term, SKOS.broader, parent))
# graph.add((parent, SKOS.narrower, term))
graph.add((term, SKOS.broader, parent))
graph.add((parent, SKOS.narrower, term))
# dct:created
graph.add((term, DCT.created, Literal(row.created, datatype=XSD.date)))
# dct:modified
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@
{% endif %}
<tr>
<td>Domain:</td>
<td>{% if term.dpv_hasDomain %}<a href="{{ term.dpv_hasDomain}}">{{ term.dpv_hasDomain|prefix_this}}</a>{% else %}<i>unspecified</i>{% endif %}</td>
<td>{% if term.dpv_hasDomain %}<a href="{{ term.dpv_hasDomain}}">{{ term.dpv_hasDomain|prefix_this}}</a>{% else %}<i>left blank / unspecified</i>{% endif %}</td>
</tr>
<tr>
<td>Range:</td>
<td>{% if term.dpv_hasRange %}<a href="{{ term.dpv_hasRange}}">{{ term.dpv_hasRange|prefix_this}}</a>{% else %}<i>unspecified</i>{% endif %}</td>
<td>{% if term.dpv_hasRange %}<a href="{{ term.dpv_hasRange}}">{{ term.dpv_hasRange|prefix_this}}</a>{% else %}<i>left blank / unspecified</i>{% endif %}</td>
</tr>
{% if term.dct_source %}
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@
{% endif %}
<tr>
<td>Domain:</td>
<td>{% if term.rdfs_domain %}<a href="{{ term.rdfs_domain}}">{{ term.rdfs_domain|prefix_this}}</a>{% else %}<i>unspecified</i>{% endif %}</td>
<td>{% if term.rdfs_domain %}<a href="{{ term.rdfs_domain}}">{{ term.rdfs_domain|prefix_this}}</a>{% else %}<i>left blank / left blank / unspecified</i>{% endif %}</td>
</tr>
<tr>
<td>Range:</td>
<td>{% if term.rdfs_range %}<a href="{{ term.rdfs_range}}">{{ term.rdfs_range|prefix_this}}</a>{% else %}<i>unspecified</i>{% endif %}</td>
<td>{% if term.rdfs_range %}<a href="{{ term.rdfs_range}}">{{ term.rdfs_range|prefix_this}}</a>{% else %}<i>left blank / left blank / unspecified</i>{% endif %}</td>
</tr>
<tr>
<td>Created:</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@
{% endif %}
<tr>
<td>Domain:</td>
<td>{% if term.rdfs_domain %}<a href="{{ term.rdfs_domain}}">{{ term.rdfs_domain|prefix_this}}</a>{% else %}<i>unspecified</i>{% endif %}</td>
<td>{% if term.rdfs_domain %}<a href="{{ term.rdfs_domain}}">{{ term.rdfs_domain|prefix_this}}</a>{% else %}<i>left blank / unspecified</i>{% endif %}</td>
</tr>
<tr>
<td>Range:</td>
<td>{% if term.rdfs_range %}<a href="{{ term.rdfs_range}}">{{ term.rdfs_range|prefix_this}}</a>{% else %}<i>unspecified</i>{% endif %}</td>
<td>{% if term.rdfs_range %}<a href="{{ term.rdfs_range}}">{{ term.rdfs_range|prefix_this}}</a>{% else %}<i>left blank / unspecified</i>{% endif %}</td>
</tr>
<tr>
<td>Created:</td>
Expand Down
12 changes: 11 additions & 1 deletion documentation-generator/jinja2_resources/template_dpv.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,17 @@

<section>
<h3>Semantics</h3>
<p>DPV's terms are defined using abstract semantic notions <span data-dfn-for="Concept"><dfn>Concept</dfn></span> and <span data-dfn-for="Relation"><dfn>Relation</dfn></span> derived from SKOS concepts and semantic relations respectively. The use of relations is bounded using <span data-dfn-for="hasDomain"><dfn>hasDomain</dfn></span> and <span data-dfn-for="hasRange"><dfn>hasRange</dfn></span>. These enable representing DPV's concepts as a <i>thesauri</i>, i.e. a list of concepts using SKOS, without any inherent semantics of their own.</p>
<p>DPV's terms are defined using abstract semantic notions <code>Concept</code> and <code>Relation</code> derived from SKOS concepts and semantic relations respectively. The use of relations is bounded using <code>hasDomain</code> and <code>hasRange</code>. These enable representing DPV's concepts as a <i>thesauri</i>, i.e. a list of concepts using SKOS, and to serialise them for different semantic models. For a summary of how these are mapped to [[RDFS]] &amp; [[SKOS]] in [[DPV-SKOS]], and [[OWL]] in [[DPV-OWL]] - see <a href="#serialisation-overview">Appendix</a>.</p>
<table>
<tbody>
<tr id="Concept"><td><dfn>Concept</dfn></td> <td>A concept</td></tr>
<tr id="Relation"><td><dfn>Relation</dfn></td> <td>A relation between concepts</td></tr>
<tr id="hasDomain"><td><dfn>hasDomain</dfn></td> <td>The domain of a relation</td></tr>
<tr id="hasRange"><td><dfn>hasRange</dfn></td> <td>The range of a relation</td></tr>
<tr id="isSubTypeOf"><td><dfn>isSubTypeOf</dfn></td> <td>A relation indicating sub-category or sub-set</td></tr>
<tr id="isInstanceOf"><td><dfn>isInstanceOf</dfn></td> <td>A relation indicating type or instance</td></tr>
</tbody>
</table>
<p>The interpretation of DPV's concept can be done through serialisation. DPV provides two such serialisations: [[DPV-OWL]] that uses OWL2 and [[DPV-SKOS]] that uses RDFS+SKOS. The <a href="#dpv-document-family">DPV Family of Documents</a> provides an overview of all serialisations related to the DPV.</p>

<p>DPV consists of certain 'core concept' that are intended to be independent representations of specific information, and are distinct from other core concepts. For example, the <a href="https://www.w3id.org/dpv#Purpose">[=Purpose=]</a> (e.g. <a href="https://www.w3id.org/dpv">Optimisation</a>) refers only to the <i>purpose of why personal data is processed</i> and is independent as a concept from the <a href="https://www.w3id.org/dpv#PersonalData">[=PersonalData=]</a> (e.g. <a href="https://www.w3id.org/dpv-pd#Location">[=Location=]</a>) or the <a href="https://www.w3id.org/dpv#Processing">[=Processing=]</a> activities (e.g. <a href="https://www.w3id.org/dpv#Collect">[=collect=]</a>, <a href="https://www.w3id.org/dpv#Store">[=store=]</a>) involved to carry out that purpose.</p>
Expand Down
Loading

0 comments on commit 4027fbd

Please sign in to comment.