diff --git a/src/yatter/constants.py b/src/yatter/constants.py index c5aad0a..96d57c2 100644 --- a/src/yatter/constants.py +++ b/src/yatter/constants.py @@ -124,27 +124,17 @@ YARRRML_MAPPINGS = 'mappings' # used for mappings in conditions and mappings main key YARRRML_MAPPING = 'mapping' -YARRRRL_MAPPINGS_SHORTCUT = 'm' -YARRRML_SUBJECTS_SHORTCUT = 's' -YARRRML_SUBJECT = 'subject' YARRRML_SUBJECTS = 'subjects' YARRRML_GRAPHS = 'graphs' -YARRRML_GRAPH = 'graph' -YARRRML_GRAPH_SHORTCUT = 'g' YARRRML_PREDICATEOBJECT = 'predicateobjects' -YARRRML_PREDICATEOBJECT_SHORTCUT = 'po' +YARRRML_PREDICATEOBJECT_SHORTCUT = 'po' #eliminar YARRRML_PREDICATES = 'predicates' -YARRRML_PREDICATE = 'predicate' -YARRRML_PREDICATES_SHORTCUT = 'p' YARRRML_OBJECTS = 'objects' -YARRRML_OBJECT = 'objects' -YARRRML_OBJECT_SHORTCUT = 'o' YARRRML_VALUE = 'value' -YARRRML_VALUE_SHORTCUT = 'v' YARRRML_DATATYPE = 'datatype' YARRRML_LANGUAGE = 'language' @@ -152,7 +142,7 @@ YARRRML_EQUAL = 'equal' YARRRML_JOIN = 'join' YARRRML_PARAMETERS = 'parameters' #used for conditions and functions -YARRRML_PARAMETERS_SHORTCUT = 'pms' + YARRRML_IRI = '~iri' YARRRML_LANG = '~lang' @@ -166,22 +156,19 @@ YARRRML_COMPRESSION = 'compression' YARRRML_FUNCTION = 'function' -YARRRML_FUNCTION_SHORTCUT_A = 'fn' -YARRRML_FUNCTION_SHORTCUT_B = 'f' YARRRML_PARAMETER = 'parameter' -YARRRML_PARAMETER_SHORTCUT = 'p' - -YARRRML_MAPPING_KEYS = [YARRRML_MAPPINGS, YARRRML_MAPPING, YARRRRL_MAPPINGS_SHORTCUT] -YARRRML_SUBJECT_KEYS = [YARRRML_SUBJECTS, YARRRML_SUBJECT, YARRRML_SUBJECTS_SHORTCUT] -YARRRML_POM_KEYS = [YARRRML_PREDICATEOBJECT, YARRRML_PREDICATEOBJECT_SHORTCUT] -YARRRML_GRAPH_KEYS = [YARRRML_GRAPHS, YARRRML_GRAPH, YARRRML_GRAPH_SHORTCUT] -YARRRML_PREDICATE_KEYS = [YARRRML_PREDICATES, YARRRML_PREDICATE, YARRRML_PREDICATES_SHORTCUT] -YARRRML_OBJECT_KEYS = [YARRRML_OBJECTS, YARRRML_OBJECT, YARRRML_OBJECT_SHORTCUT] -YARRRML_FUNCTION_KEYS = [YARRRML_FUNCTION, YARRRML_FUNCTION_SHORTCUT_A, YARRRML_FUNCTION_SHORTCUT_B] -YARRRML_PARAMETERS_KEYS = [YARRRML_PARAMETERS, YARRRML_PARAMETERS_SHORTCUT] -YARRRML_PARAMETER_KEYS = [YARRRML_PARAMETER, YARRRML_PARAMETER_SHORTCUT] -YARRRML_VALUE_KEYS = [YARRRML_VALUE, YARRRML_VALUE_SHORTCUT] + +YARRRML_MAPPING_KEYS = [YARRRML_MAPPINGS, YARRRML_MAPPING] +YARRRML_SUBJECT_KEYS = [YARRRML_SUBJECTS] +YARRRML_POM_KEYS = [YARRRML_PREDICATEOBJECT] +YARRRML_GRAPH_KEYS = [YARRRML_GRAPHS] +YARRRML_PREDICATE_KEYS = [YARRRML_PREDICATES] +YARRRML_OBJECT_KEYS = [YARRRML_OBJECTS] +YARRRML_FUNCTION_KEYS = [YARRRML_FUNCTION] +YARRRML_PARAMETERS_KEYS = [YARRRML_PARAMETERS] +YARRRML_PARAMETER_KEYS = [YARRRML_PARAMETER] +YARRRML_VALUE_KEYS = [YARRRML_VALUE] YARRRML_OUTPUT_FORMAT = { diff --git a/src/yatter/mapping.py b/src/yatter/mapping.py index 7437cf8..d785d5b 100644 --- a/src/yatter/mapping.py +++ b/src/yatter/mapping.py @@ -107,8 +107,8 @@ def get_non_asserted_mappings(yarrrml_data, mapping_format): for value in yarrrml_data.get(YARRRML_MAPPINGS).get(mapping).get(key): if type(value) is dict: star_data = [value] - if YARRRML_OBJECT_SHORTCUT in value: - star_data = value[YARRRML_OBJECT_SHORTCUT] + if YARRRML_OBJECTS in value: + star_data = value[YARRRML_OBJECTS] for val in star_data: if YARRRML_NON_ASSERTED in val: mappings[val[YARRRML_NON_ASSERTED]] = "non_asserted"