Skip to content

Commit cb15152

Browse files
committed
5.3 - ValPub valid
1 parent 9e02cf3 commit cb15152

6 files changed

Lines changed: 1204 additions & 715 deletions

File tree

examples/05-valid-qualdev.ttl

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Qualified Derivation is indicated correctly
2+
3+
PREFIX cs: <http://linked.data.gov.au/def/data-access-rights>
4+
PREFIX da: <http://linked.data.gov.au/def/data-access-rights/>
5+
PREFIX dcterms: <http://purl.org/dc/terms/>
6+
PREFIX owl: <http://www.w3.org/2002/07/owl#>
7+
PREFIX prov: <http://www.w3.org/ns/prov#>
8+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
9+
PREFIX schema: <https://schema.org/>
10+
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
11+
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
12+
13+
da:closed-access-rights
14+
a skos:Collection ;
15+
dcterms:provenance "Created in this vocabulary" ;
16+
rdfs:isDefinedBy cs: ;
17+
skos:definition "Selective restriction of access to data that is OFFICIAL (low or negligible confidentiality impact), SENSITIVE (moderate confidentiality impact) or PROTECTED (high confidentiality impact)."@en ;
18+
skos:inScheme cs: ;
19+
skos:member
20+
da:embargoed ,
21+
da:metadata-only ,
22+
da:protected ,
23+
da:restricted ;
24+
skos:prefLabel "Closed data access rights"@en ;
25+
.
26+
27+
da:open-access-rights
28+
a skos:Collection ;
29+
dcterms:provenance "Created in this vocabulary" ;
30+
rdfs:isDefinedBy cs: ;
31+
skos:definition "Data that is non-sensitive, freely available, easily discovered and accessed, and published in ways and with licences that allow easy reuse."@en ;
32+
skos:inScheme cs: ;
33+
skos:member da:open ;
34+
skos:prefLabel "Open data access rights"@en ;
35+
.
36+
37+
da:embargoed
38+
a skos:Concept ;
39+
rdfs:isDefinedBy cs: ;
40+
skos:broader da:protected ;
41+
skos:definition "Embargoed access refers to a resource accessible as metadata only until released for open access on a specified date."@en ;
42+
skos:inScheme cs: ;
43+
skos:prefLabel "Embargoed access"@en ;
44+
.
45+
46+
da:metadata-only
47+
a skos:Concept ;
48+
rdfs:isDefinedBy cs: ;
49+
skos:broader da:protected ;
50+
skos:definition "Metadata only access refers to a resource in which access is limited to metadata only. Access to the resource requires granting of access rights."@en ;
51+
skos:inScheme cs: ;
52+
skos:prefLabel "Metadata only access"@en ;
53+
.
54+
55+
da:open
56+
a skos:Concept ;
57+
rdfs:isDefinedBy cs: ;
58+
skos:altLabel "Open file"@en ;
59+
skos:definition "Open access refers to a resource that is immediately and permanently online, and free for all on the Web, without financial and technical barriers."@en ;
60+
skos:inScheme cs: ;
61+
skos:prefLabel "Open access"@en ;
62+
skos:topConceptOf cs: ;
63+
.
64+
65+
da:restricted
66+
a skos:Concept ;
67+
rdfs:isDefinedBy cs: ;
68+
skos:definition "Restricted access refers to a resource that is stored in a system but is not freely accessible. Access is limited to specific personnel or user groups."@en ;
69+
skos:inScheme cs: ;
70+
skos:prefLabel "Restricted access"@en ;
71+
skos:topConceptOf cs: ;
72+
.
73+
74+
<http://linked.data.gov.au/org/gsq>
75+
a schema:Organization ;
76+
schema:name "Geological Survey of Queensland" ;
77+
schema:url "https://www.business.qld.gov.au/industries/mining-energy-water/resources/geoscience-information/gsq"^^xsd:anyURI ;
78+
.
79+
80+
da:protected
81+
a skos:Concept ;
82+
rdfs:isDefinedBy cs: ;
83+
skos:broader da:protected ;
84+
skos:definition "Protected access refers to a resource that is stored in a system but is not freely accessible due to specific legal or policy decisions, such as active legal proceedings or ministerial discretion. Access is limited to specific personnel or user groups. "@en ;
85+
skos:inScheme cs: ;
86+
skos:prefLabel "Protected access"@en ;
87+
.
88+
89+
cs:
90+
a
91+
owl:Ontology ,
92+
skos:ConceptScheme ;
93+
dcterms:created "2019-04-03"^^xsd:date ;
94+
dcterms:creator <http://linked.data.gov.au/org/gsq> ;
95+
dcterms:modified "2019-09-10"^^xsd:date ;
96+
dcterms:publisher <http://linked.data.gov.au/org/gsq> ;
97+
dcterms:source "http://vocabularies.coar-repositories.org/documentation/access_rights/"^^xsd:anyURI ;
98+
skos:definition "Data access rights control how users and systems access a data resource."@en ;
99+
skos:hasTopConcept
100+
da:open ,
101+
da:restricted ;
102+
skos:historyNote "This vocabulary is taken from the COAR Controlled Vocabularies Interest Group (http://vocabularies.coar-repositories.org/documentation/access_rights/) but is redelivered as that vocabulary isn't well presented online."@en ;
103+
skos:prefLabel "Data Access Rights"@en ;
104+
prov:qualifiedDerivation
105+
[
106+
prov:entity <http://example.com/vocab/x> ;
107+
prov:hadRole <http://example.com/role/y> ;
108+
] ;
109+
.

examples/06-invalid-qualdev.ttl

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Qualified Derivation indicates a string, not a BN, as per Requirement 2.1.11
2+
3+
PREFIX cs: <http://linked.data.gov.au/def/data-access-rights>
4+
PREFIX da: <http://linked.data.gov.au/def/data-access-rights/>
5+
PREFIX dcterms: <http://purl.org/dc/terms/>
6+
PREFIX owl: <http://www.w3.org/2002/07/owl#>
7+
PREFIX prov: <http://www.w3.org/ns/prov#>
8+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
9+
PREFIX schema: <https://schema.org/>
10+
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
11+
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
12+
13+
da:closed-access-rights
14+
a skos:Collection ;
15+
dcterms:provenance "Created in this vocabulary" ;
16+
rdfs:isDefinedBy cs: ;
17+
skos:definition "Selective restriction of access to data that is OFFICIAL (low or negligible confidentiality impact), SENSITIVE (moderate confidentiality impact) or PROTECTED (high confidentiality impact)."@en ;
18+
skos:inScheme cs: ;
19+
skos:member
20+
da:embargoed ,
21+
da:metadata-only ,
22+
da:protected ,
23+
da:restricted ;
24+
skos:prefLabel "Closed data access rights"@en ;
25+
.
26+
27+
da:open-access-rights
28+
a skos:Collection ;
29+
dcterms:provenance "Created in this vocabulary" ;
30+
rdfs:isDefinedBy cs: ;
31+
skos:definition "Data that is non-sensitive, freely available, easily discovered and accessed, and published in ways and with licences that allow easy reuse."@en ;
32+
skos:inScheme cs: ;
33+
skos:member da:open ;
34+
skos:prefLabel "Open data access rights"@en ;
35+
.
36+
37+
da:embargoed
38+
a skos:Concept ;
39+
rdfs:isDefinedBy cs: ;
40+
skos:broader da:protected ;
41+
skos:definition "Embargoed access refers to a resource accessible as metadata only until released for open access on a specified date."@en ;
42+
skos:inScheme cs: ;
43+
skos:prefLabel "Embargoed access"@en ;
44+
.
45+
46+
da:metadata-only
47+
a skos:Concept ;
48+
rdfs:isDefinedBy cs: ;
49+
skos:broader da:protected ;
50+
skos:definition "Metadata only access refers to a resource in which access is limited to metadata only. Access to the resource requires granting of access rights."@en ;
51+
skos:inScheme cs: ;
52+
skos:prefLabel "Metadata only access"@en ;
53+
.
54+
55+
da:open
56+
a skos:Concept ;
57+
rdfs:isDefinedBy cs: ;
58+
skos:altLabel "Open file"@en ;
59+
skos:definition "Open access refers to a resource that is immediately and permanently online, and free for all on the Web, without financial and technical barriers."@en ;
60+
skos:inScheme cs: ;
61+
skos:prefLabel "Open access"@en ;
62+
skos:topConceptOf cs: ;
63+
.
64+
65+
da:restricted
66+
a skos:Concept ;
67+
rdfs:isDefinedBy cs: ;
68+
skos:definition "Restricted access refers to a resource that is stored in a system but is not freely accessible. Access is limited to specific personnel or user groups."@en ;
69+
skos:inScheme cs: ;
70+
skos:prefLabel "Restricted access"@en ;
71+
skos:topConceptOf cs: ;
72+
.
73+
74+
<http://linked.data.gov.au/org/gsq>
75+
a schema:Organization ;
76+
schema:name "Geological Survey of Queensland" ;
77+
schema:url "https://www.business.qld.gov.au/industries/mining-energy-water/resources/geoscience-information/gsq"^^xsd:anyURI ;
78+
.
79+
80+
da:protected
81+
a skos:Concept ;
82+
rdfs:isDefinedBy cs: ;
83+
skos:broader da:protected ;
84+
skos:definition "Protected access refers to a resource that is stored in a system but is not freely accessible due to specific legal or policy decisions, such as active legal proceedings or ministerial discretion. Access is limited to specific personnel or user groups. "@en ;
85+
skos:inScheme cs: ;
86+
skos:prefLabel "Protected access"@en ;
87+
.
88+
89+
cs:
90+
a
91+
owl:Ontology ,
92+
skos:ConceptScheme ;
93+
dcterms:created "2019-04-03"^^xsd:date ;
94+
dcterms:creator <http://linked.data.gov.au/org/gsq> ;
95+
dcterms:modified "2019-09-10"^^xsd:date ;
96+
dcterms:publisher <http://linked.data.gov.au/org/gsq> ;
97+
dcterms:source "http://vocabularies.coar-repositories.org/documentation/access_rights/"^^xsd:anyURI ;
98+
skos:definition "Data access rights control how users and systems access a data resource."@en ;
99+
skos:hasTopConcept
100+
da:open ,
101+
da:restricted ;
102+
skos:historyNote "This vocabulary is taken from the COAR Controlled Vocabularies Interest Group (http://vocabularies.coar-repositories.org/documentation/access_rights/) but is redelivered as that vocabulary isn't well presented online."@en ;
103+
skos:prefLabel "Data Access Rights"@en ;
104+
prov:qualifiedDerivation "this should not be a string" ;
105+
.

tests/test_examples.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
VALIDATORS_DIR = Path(__file__).parent.parent.resolve() / "validators"
77

88
def test_examples():
9+
print()
910
for f in sorted(list(EG_DIR.glob("*.ttl"))):
1011
validity = False if "invalid" in str(f.name) else True
1112

@@ -14,7 +15,7 @@ def test_examples():
1415
elif "multilang" in str(f.name):
1516
validator = VALIDATORS_DIR / "validator.multilang.ttl"
1617
else:
17-
validator = VALIDATORS_DIR / "validator.ttl"
18+
validator = VALIDATORS_DIR / "vocpub.ttl"
1819

1920
data_g = Graph().parse(f)
2021
validator_g = Graph().parse(validator)
@@ -23,4 +24,5 @@ def test_examples():
2324
validator_g.parse(VALIDATORS_DIR / "expander.ttl")
2425

2526
v = validate(data_g, shacl_graph=validator_g, allow_warnings=True, advanced=True)
26-
assert v[0] == validity, print(f.name)
27+
assert v[0] == validity, print(f"{f.name} is not correct: {v[2]}")
28+
print(f"{f.name} is correct")

0 commit comments

Comments
 (0)