-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #200 from GovDataOfficial/rights-statements-uriref
Also process URIRef in rights statements
- Loading branch information
Showing
3 changed files
with
34 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -321,7 +321,7 @@ def test_dataset_contact_point_vcard_hasEmail_hasValue(self): | |
extras = self._extras(dataset) | ||
assert extras['contact_email'] == '[email protected]' | ||
|
||
def test_dataset_access_rights_and_distribution_rights_rights_statement(self): | ||
def test_dataset_access_rights_and_distribution_rights_rights_statement_literal(self): | ||
# license_id retrieved from the URI of dcat:license object | ||
g = Graph() | ||
|
||
|
@@ -352,6 +352,36 @@ def test_dataset_access_rights_and_distribution_rights_rights_statement(self): | |
resource = dataset['resources'][0] | ||
assert resource['rights'] == 'public distribution' | ||
|
||
def test_dataset_access_rights_and_distribution_rights_rights_statement_uriref(self): | ||
g = Graph() | ||
|
||
dataset_ref = URIRef("http://example.org/datasets/1") | ||
g.add((dataset_ref, RDF.type, DCAT.Dataset)) | ||
|
||
# access_rights | ||
access_rights = BNode() | ||
g.add((access_rights, RDF.type, DCT.RightsStatement)) | ||
g.add((access_rights, RDFS.label, URIRef("http://example.org/datasets/1/ds/3"))) | ||
g.add((dataset_ref, DCT.accessRights, access_rights)) | ||
# rights | ||
rights = BNode() | ||
g.add((rights, RDF.type, DCT.RightsStatement)) | ||
g.add((rights, RDFS.label, URIRef("http://example.org/datasets/1/ds/2"))) | ||
distribution = URIRef("http://example.org/datasets/1/ds/1") | ||
g.add((dataset_ref, DCAT.distribution, distribution)) | ||
g.add((distribution, RDF.type, DCAT.Distribution)) | ||
g.add((distribution, DCT.rights, rights)) | ||
|
||
p = RDFParser(profiles=['euro_dcat_ap']) | ||
|
||
p.g = g | ||
|
||
dataset = [d for d in p.datasets()][0] | ||
extras = self._extras(dataset) | ||
assert extras['access_rights'] == 'http://example.org/datasets/1/ds/3' | ||
resource = dataset['resources'][0] | ||
assert resource['rights'] == 'http://example.org/datasets/1/ds/2' | ||
|
||
def test_distribution_access_url(self): | ||
g = Graph() | ||
|
||
|