Skip to content

Commit

Permalink
Deleting unused constants
Browse files Browse the repository at this point in the history
  • Loading branch information
bhorinrb committed Dec 11, 2024
1 parent 1d9ad8a commit cf60093
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 28 deletions.
39 changes: 13 additions & 26 deletions src/yatter/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,35 +124,25 @@

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'

YARRRML_CONDITION = 'condition'
YARRRML_EQUAL = 'equal'
YARRRML_JOIN = 'join'
YARRRML_PARAMETERS = 'parameters' #used for conditions and functions
YARRRML_PARAMETERS_SHORTCUT = 'pms'


YARRRML_IRI = '~iri'
YARRRML_LANG = '~lang'
Expand All @@ -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 = {
Expand Down
4 changes: 2 additions & 2 deletions src/yatter/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit cf60093

Please sign in to comment.