Skip to content

Commit

Permalink
fix: fixed URI for dc namespace
Browse files Browse the repository at this point in the history
jonrkarr committed Mar 1, 2022
1 parent 6a6874e commit 9653ad9
Showing 22 changed files with 55 additions and 55 deletions.
58 changes: 29 additions & 29 deletions biosimulators_utils/omex_meta/data_model.py
Original file line number Diff line number Diff line change
@@ -78,25 +78,25 @@ class OmexMetadataSchema(str, enum.Enum):
BIOSIMULATIONS_ROOT_URI_PATTERN = r'^(http://omex-library\.org/.*?\.omex)(/|$)'

BIOSIMULATIONS_PREDICATE_TYPES = {
'http://dublincore.org/specifications/dublin-core/dcmi-terms/title': {
'http://purl.org/dc/elements/1.1/title': {
'namespace': {
'prefix': 'dc',
'uri': 'http://dublincore.org/specifications/dublin-core/dcmi-terms/',
'uri': 'http://purl.org/dc/elements/1.1/',
},
'uri': 'http://dublincore.org/specifications/dublin-core/dcmi-terms/title',
'uri': 'http://purl.org/dc/elements/1.1/title',
'attribute': 'title',
'label': 'title',
'multiple_allowed': False,
'has_uri': False,
'has_label': True,
'required': True,
},
'http://dublincore.org/specifications/dublin-core/dcmi-terms/abstract': {
'http://purl.org/dc/elements/1.1/abstract': {
'namespace': {
'prefix': 'dc',
'uri': 'http://dublincore.org/specifications/dublin-core/dcmi-terms/',
'uri': 'http://purl.org/dc/elements/1.1/',
},
'uri': 'http://dublincore.org/specifications/dublin-core/dcmi-terms/abstract',
'uri': 'http://purl.org/dc/elements/1.1/abstract',
'attribute': 'abstract',
'label': 'Abstract',
'multiple_allowed': False,
@@ -117,12 +117,12 @@ class OmexMetadataSchema(str, enum.Enum):
'has_label': True,
'required': False,
},
'http://dublincore.org/specifications/dublin-core/dcmi-terms/description': {
'http://purl.org/dc/elements/1.1/description': {
'namespace': {
'prefix': 'dc',
'uri': 'http://dublincore.org/specifications/dublin-core/dcmi-terms/',
'uri': 'http://purl.org/dc/elements/1.1/',
},
'uri': 'http://dublincore.org/specifications/dublin-core/dcmi-terms/description',
'uri': 'http://purl.org/dc/elements/1.1/description',
'attribute': 'description',
'label': 'Description',
'multiple_allowed': False,
@@ -169,12 +169,12 @@ class OmexMetadataSchema(str, enum.Enum):
'has_label': False,
'required': False,
},
'http://dublincore.org/specifications/dublin-core/dcmi-terms/source': {
'http://purl.org/dc/elements/1.1/source': {
'namespace': {
'prefix': 'dc',
'uri': 'http://dublincore.org/specifications/dublin-core/dcmi-terms/',
'uri': 'http://purl.org/dc/elements/1.1/',
},
'uri': 'http://dublincore.org/specifications/dublin-core/dcmi-terms/source',
'uri': 'http://purl.org/dc/elements/1.1/source',
'attribute': 'sources',
'label': 'Sources',
'multiple_allowed': True,
@@ -234,25 +234,25 @@ class OmexMetadataSchema(str, enum.Enum):
'has_label': True,
'required': False,
},
'http://dublincore.org/specifications/dublin-core/dcmi-terms/creator': {
'http://purl.org/dc/elements/1.1/creator': {
'namespace': {
'prefix': 'dc',
'uri': 'http://dublincore.org/specifications/dublin-core/dcmi-terms/',
'uri': 'http://purl.org/dc/elements/1.1/',
},
'uri': 'http://dublincore.org/specifications/dublin-core/dcmi-terms/creator',
'uri': 'http://purl.org/dc/elements/1.1/creator',
'attribute': 'creators',
'label': 'Creators',
'multiple_allowed': True,
'has_uri': True,
'has_label': True,
'required': False,
},
'http://dublincore.org/specifications/dublin-core/dcmi-terms/contributor': {
'http://purl.org/dc/elements/1.1/contributor': {
'namespace': {
'prefix': 'dc',
'uri': 'http://dublincore.org/specifications/dublin-core/dcmi-terms/',
'uri': 'http://purl.org/dc/elements/1.1/',
},
'uri': 'http://dublincore.org/specifications/dublin-core/dcmi-terms/contributor',
'uri': 'http://purl.org/dc/elements/1.1/contributor',
'attribute': 'contributors',
'label': 'Contributors',
'multiple_allowed': True,
@@ -286,12 +286,12 @@ class OmexMetadataSchema(str, enum.Enum):
'has_label': True,
'required': False,
},
'http://dublincore.org/specifications/dublin-core/dcmi-terms/license': {
'http://purl.org/dc/elements/1.1/license': {
'namespace': {
'prefix': 'dc',
'uri': 'http://dublincore.org/specifications/dublin-core/dcmi-terms/',
'uri': 'http://purl.org/dc/elements/1.1/',
},
'uri': 'http://dublincore.org/specifications/dublin-core/dcmi-terms/license',
'uri': 'http://purl.org/dc/elements/1.1/license',
'attribute': 'license',
'label': 'License',
'multiple_allowed': False,
@@ -312,25 +312,25 @@ class OmexMetadataSchema(str, enum.Enum):
'has_label': True,
'required': False,
},
'http://dublincore.org/specifications/dublin-core/dcmi-terms/created': {
'http://purl.org/dc/elements/1.1/created': {
'namespace': {
'prefix': 'dc',
'uri': 'http://dublincore.org/specifications/dublin-core/dcmi-terms/',
'uri': 'http://purl.org/dc/elements/1.1/',
},
'uri': 'http://dublincore.org/specifications/dublin-core/dcmi-terms/created',
'uri': 'http://purl.org/dc/elements/1.1/created',
'attribute': 'created',
'label': 'Created',
'multiple_allowed': False,
'has_uri': False,
'has_label': True,
'required': False,
},
'http://dublincore.org/specifications/dublin-core/dcmi-terms/modified': {
'http://purl.org/dc/elements/1.1/modified': {
'namespace': {
'prefix': 'dc',
'uri': 'http://dublincore.org/specifications/dublin-core/dcmi-terms/',
'uri': 'http://purl.org/dc/elements/1.1/',
},
'uri': 'http://dublincore.org/specifications/dublin-core/dcmi-terms/modified',
'uri': 'http://purl.org/dc/elements/1.1/modified',
'attribute': 'modified',
'label': 'Modified',
'multiple_allowed': True,
@@ -343,7 +343,7 @@ class OmexMetadataSchema(str, enum.Enum):
BIOSIMULATIONS_NAMESPACE_PREFIX_MAP = {
'http://biomodels.net/biology-qualifiers/': 'bqbiol',
'http://biomodels.net/model-qualifiers/': 'biomodel',
'http://dublincore.org/specifications/dublin-core/dcmi-terms/': 'dc',
'http://purl.org/dc/elements/1.1/': 'dc',
'http://prismstandard.org/namespaces/basic/2.0/': 'prism',
'http://purl.org/dc/terms/': 'dcterms',
'http://purl.org/spar/scoro/': 'scoro',
@@ -354,7 +354,7 @@ class OmexMetadataSchema(str, enum.Enum):
}

BIOSIMULATIONS_NAMESPACE_ALIASES = {
'http://purl.org/dc/elements/1.1/': 'http://dublincore.org/specifications/dublin-core/dcmi-terms/',
'http://dublincore.org/specifications/dublin-core/dcmi-terms/': 'http://purl.org/dc/elements/1.1/',
'http://sempublishing.sourceforge.net/scoro/': 'http://purl.org/spar/scoro/',
}

12 changes: 6 additions & 6 deletions biosimulators_utils/omex_meta/io.py
Original file line number Diff line number Diff line change
@@ -652,7 +652,7 @@ def parse_triples_to_schema(cls, triples, combine_archive_uri):
}
for sub_el in el['value'].get('other', []):
if (
sub_el['predicate'] == 'http://dublincore.org/specifications/dublin-core/dcmi-terms/identifier'
sub_el['predicate'] == 'http://purl.org/dc/elements/1.1/identifier'
and 'uri' in sub_el['value']
):
value['uri'] = sub_el['value']['uri']
@@ -729,13 +729,13 @@ def parse_triples_to_schema(cls, triples, combine_archive_uri):
}
for el in other_md['value'].get('description', []):
if (
el['predicate'] == 'http://dublincore.org/specifications/dublin-core/dcmi-terms/description'
el['predicate'] == 'http://purl.org/dc/elements/1.1/description'
and 'label' in el['value']
):
value['attribute']['label'] = el['value']['label']
for el in other_md['value'].get('other', []):
if (
el['predicate'] == 'http://dublincore.org/specifications/dublin-core/dcmi-terms/identifier'
el['predicate'] == 'http://purl.org/dc/elements/1.1/identifier'
and 'uri' in el['value']
):
value['value']['uri'] = el['value']['uri']
@@ -794,7 +794,7 @@ def run(self, el_metadatas, filename, config=None):
local_id = 0

namespaces = {
'dc': rdflib.Namespace('http://dublincore.org/specifications/dublin-core/dcmi-terms/'),
'dc': rdflib.Namespace('http://purl.org/dc/elements/1.1/'),
'dcterms': rdflib.Namespace('http://purl.org/dc/terms/'),
'foaf': rdflib.Namespace('http://xmlns.com/foaf/0.1/'),
'rdfs': rdflib.Namespace('http://www.w3.org/2000/01/rdf-schema#'),
@@ -839,8 +839,8 @@ def run(self, el_metadatas, filename, config=None):
))

if predicate_type['uri'] in [
'http://dublincore.org/specifications/dublin-core/dcmi-terms/creator',
'http://dublincore.org/specifications/dublin-core/dcmi-terms/contributor',
'http://purl.org/dc/elements/1.1/creator',
'http://purl.org/dc/elements/1.1/contributor',
]:
if value.get('uri', None) is not None:
if value['uri'].lower().startswith('mailto:'):
2 changes: 1 addition & 1 deletion tests/fixtures/omex-metadata/abbrev.rdf
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
xmlns:bqmodel="http://biomodels.net/model-qualifiers/"
xmlns:dc="http://dublincore.org/specifications/dublin-core/dcmi-terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:prism="http://prismstandard.org/namespaces/basic/2.0/"
xmlns:scoro="http://purl.org/spar/scoro/"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF
xmlns:dc="http://dublincore.org/specifications/dublin-core/dcmi-terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>
<rdf:Description rdf:about="http://omex-library.org/BioSim0001.omex">
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
xmlns:bqmodel="http://biomodels.net/model-qualifiers/"
xmlns:collex="http://www.collex.org/schema#"
xmlns:dc="http://dublincore.org/specifications/dublin-core/dcmi-terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:om="http://ontology.eil.utoronto.ca/icity/OM/"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF
xmlns:bqmodel="http://biomodels.net/model-qualifiers/"
xmlns:dc="http://dublincore.org/specifications/dublin-core/dcmi-terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
>
2 changes: 1 addition & 1 deletion tests/fixtures/omex-metadata/biosimulations-abbrev.rdf
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
xmlns:bqmodel="http://biomodels.net/model-qualifiers/"
xmlns:collex="http://www.collex.org/schema#"
xmlns:dc="http://dublincore.org/specifications/dublin-core/dcmi-terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:om="http://ontology.eil.utoronto.ca/icity/OM/"
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
xmlns:bqmodel="http://biomodels.net/model-qualifiers/"
xmlns:collex="http://www.collex.org/schema#"
xmlns:dc="http://dublincore.org/specifications/dublin-core/dcmi-terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:om="http://ontology.eil.utoronto.ca/icity/OM/"
2 changes: 1 addition & 1 deletion tests/fixtures/omex-metadata/biosimulations.rdf
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
xmlns:bqmodel="http://biomodels.net/model-qualifiers/"
xmlns:collex="http://www.collex.org/schema#"
xmlns:dc="http://dublincore.org/specifications/dublin-core/dcmi-terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:om="http://ontology.eil.utoronto.ca/icity/OM/"
2 changes: 1 addition & 1 deletion tests/fixtures/omex-metadata/invalid-thumbnail-uri.rdf
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
xmlns:bqmodel="http://biomodels.net/model-qualifiers/"
xmlns:collex="http://www.collex.org/schema#"
xmlns:dc="http://dublincore.org/specifications/dublin-core/dcmi-terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:om="http://ontology.eil.utoronto.ca/icity/OM/"
2 changes: 1 addition & 1 deletion tests/fixtures/omex-metadata/invalid.rdf
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
xmlns:bqmodel="http://biomodels.net/model-qualifiers/"
xmlns:collex="http://www.collex.org/schema#"
xmlns:dc="http://dublincore.org/specifications/dublin-core/dcmi-terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:om="http://ontology.eil.utoronto.ca/icity/OM/"
2 changes: 1 addition & 1 deletion tests/fixtures/omex-metadata/malformed.rdf
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
xmlns:bqmodel="http://biomodels.net/model-qualifiers/"
xmlns:dc="http://dublincore.org/specifications/dublin-core/dcmi-terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:collex="http://www.collex.org/schema#"
>
2 changes: 1 addition & 1 deletion tests/fixtures/omex-metadata/missing-label-2.rdf
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
xmlns:bqmodel="http://biomodels.net/model-qualifiers/"
xmlns:dc="http://dublincore.org/specifications/dublin-core/dcmi-terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:prism="http://prismstandard.org/namespaces/basic/2.0/"
xmlns:scoro="http://purl.org/spar/scoro/"
2 changes: 1 addition & 1 deletion tests/fixtures/omex-metadata/missing-label.rdf
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
xmlns:bqmodel="http://biomodels.net/model-qualifiers/"
xmlns:dc="http://dublincore.org/specifications/dublin-core/dcmi-terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:prism="http://prismstandard.org/namespaces/basic/2.0/"
xmlns:scoro="http://purl.org/spar/scoro/"
2 changes: 1 addition & 1 deletion tests/fixtures/omex-metadata/missing-required.rdf
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
xmlns:bqmodel="http://biomodels.net/model-qualifiers/"
xmlns:dc="http://dublincore.org/specifications/dublin-core/dcmi-terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:prism="http://prismstandard.org/namespaces/basic/2.0/"
xmlns:scoro="http://purl.org/spar/scoro/"
2 changes: 1 addition & 1 deletion tests/fixtures/omex-metadata/missing-thumbnail-uri.rdf
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
xmlns:bqmodel="http://biomodels.net/model-qualifiers/"
xmlns:dc="http://dublincore.org/specifications/dublin-core/dcmi-terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:prism="http://prismstandard.org/namespaces/basic/2.0/"
xmlns:scoro="http://purl.org/spar/scoro/"
2 changes: 1 addition & 1 deletion tests/fixtures/omex-metadata/missing-uri.rdf
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
xmlns:bqmodel="http://biomodels.net/model-qualifiers/"
xmlns:collex="http://www.collex.org/schema#"
xmlns:dc="http://dublincore.org/specifications/dublin-core/dcmi-terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:om="http://ontology.eil.utoronto.ca/icity/OM/"
2 changes: 1 addition & 1 deletion tests/fixtures/omex-metadata/multiple-roots.rdf
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
xmlns:bqmodel="http://biomodels.net/model-qualifiers/"
xmlns:dc="http://dublincore.org/specifications/dublin-core/dcmi-terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:prism="http://prismstandard.org/namespaces/basic/2.0/"
xmlns:scoro="http://purl.org/spar/scoro/"
2 changes: 1 addition & 1 deletion tests/fixtures/omex-metadata/multiple-thumbnails.rdf
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
xmlns:bqmodel="http://biomodels.net/model-qualifiers/"
xmlns:collex="http://www.collex.org/schema#"
xmlns:dc="http://dublincore.org/specifications/dublin-core/dcmi-terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:om="http://ontology.eil.utoronto.ca/icity/OM/"
2 changes: 1 addition & 1 deletion tests/fixtures/omex-metadata/no-root.rdf
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
xmlns:bqmodel="http://biomodels.net/model-qualifiers/"
xmlns:dc="http://dublincore.org/specifications/dublin-core/dcmi-terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:prism="http://prismstandard.org/namespaces/basic/2.0/"
xmlns:scoro="http://purl.org/spar/scoro/"
2 changes: 1 addition & 1 deletion tests/fixtures/omex-metadata/too-many-objects.rdf
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
xmlns:bqmodel="http://biomodels.net/model-qualifiers/"
xmlns:dc="http://dublincore.org/specifications/dublin-core/dcmi-terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:prism="http://prismstandard.org/namespaces/basic/2.0/"
xmlns:scoro="http://purl.org/spar/scoro/"
2 changes: 1 addition & 1 deletion tests/fixtures/omex-metadata/warning.rdf
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
xmlns:bqmodel="http://biomodels.net/model-qualifiers/"
xmlns:dc="http://dublincore.org/specifications/dublin-core/dcmi-terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:collex="http://www.collex.org/schema#"
>

0 comments on commit 9653ad9

Please sign in to comment.