Skip to content

Commit

Permalink
#53 Got rid of django models that held the RDF schema and tags relati…
Browse files Browse the repository at this point in the history
…on to the Controlled Vocabularies' fields. These relations are now setup in the controlled_vocabularies.py module.
  • Loading branch information
jcaraballo17 committed Dec 2, 2020
1 parent 6561eb1 commit 5ccc11c
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 0 deletions.
112 changes: 112 additions & 0 deletions src/odm2cvs/controlled_vocabularies.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,27 @@
'update_template':(optional) {string: a custom request update template},
}
}
The links between the Controlled Vocabularies fields and SKOS are defined in
the `rdf_field_relations` and `rdf_namespace_references` dictionaries.
The format for each field relation is the following:
'{controlled vocabulary field name}': {
'node': '{string: rdf equivalent tag}',
'namespace': '{string: namespace to be used for the rdf tag}'
},
For the namespace references, the format is the following:
{
'{namespace name}': '{string: URL reference to the namespace}',
...
}
"""

from typing import Dict, Any, Type
Expand Down Expand Up @@ -170,3 +191,94 @@ def update_vocabularies_dict(sender: Type, **kwargs) -> None:
'abstract_parents': (AbstractUnitsType,),
},
}


rdf_namespace_references: Dict[str, str] = {
'dc': 'http://purl.org/dc/elements/1.1/',
'skos': 'http://www.w3.org/2004/02/skos/core',
'odm2': 'http://vocabulary.odm2.org/ODM2/ODM2Terms'
}


rdf_field_relations: Dict[str, Dict[str, str]] = {
'name': {
'node': 'prefLabel',
'namespace': 'skos'
},
'definition': {
'node': 'definition',
'namespace': 'skos'
},
'note': {
'node': 'note',
'namespace': 'skos'
},
'provenance': {
'node': 'historyNote',
'namespace': 'skos'
},
'provenance_uri': {
'node': 'exactMatch',
'namespace': 'skos'
},
'category': {
'node': 'category',
'namespace': 'odm2'
},
'produces_result': {
'node': 'producesResult',
'namespace': 'odm2'
},
'term': {
'node': 'Concept',
'namespace': 'skos'
},
'offset1': {
'node': 'offset1',
'namespace': 'odm2'
},
'offset2': {
'node': 'offset2',
'namespace': 'odm2'
},
'offset3': {
'node': 'offset3',
'namespace': 'odm2'
},
'default_unit': {
'node': 'defaultUnit',
'namespace': 'odm2'
},
'dimension_symbol': {
'node': 'dimensionSymbol',
'namespace': 'odm2'
},
'dimension_length': {
'node': 'dimensionLength',
'namespace': 'odm2'
},
'dimension_mass': {
'node': 'dimensionMass',
'namespace': 'odm2'
},
'dimension_time': {
'node': 'dimensionTime',
'namespace': 'odm2'
},
'dimension_current': {
'node': 'dimensionCurrent',
'namespace': 'odm2'
},
'dimension_temperature': {
'node': 'dimensionTemperature',
'namespace': 'odm2'
},
'dimension_amount': {
'node': 'dimensionAmount',
'namespace': 'odm2'
},
'dimension_light': {
'node': 'dimensionLight',
'namespace': 'odm2'
}
}
1 change: 1 addition & 0 deletions src/odm2cvs/settings/settings_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"debug_mode": "{boolean: flag to activate debug mode}",
"host": "{string: server main domain name}",
"host_alias": "{list: list of extra domain names to serve the application at}",
"scheme_creator": "{string: the name of the group or organization that created these controlled vocabularies}",
"static": {
"url": "{string: static files url}",
"root": "{string: static files root path}"
Expand Down

0 comments on commit 5ccc11c

Please sign in to comment.