-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yatter2 #1
base: main
Are you sure you want to change the base?
Yatter2 #1
Changes from all commits
00adfd8
d1abc40
0c9ab82
2b186e6
28a2127
4dfc41a
81509d3
b20ad4e
36e8c57
3afb790
d113f67
6c43f1d
aeb5e6c
78999c3
ef667da
56f1bd6
1d9ad8a
cf60093
3bdcd64
a509185
13d1b3c
294b1dc
ca24f92
0a550d0
564a233
27e718c
f5711c7
f9dedfe
ab0873a
89bf751
b69f3c5
cb55dd9
e8b1faf
c77ce80
ac545fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,24 @@ | |
lib/__pychache__ | ||
.idea | ||
venv | ||
.pytest_cache | ||
.pytest_cache | ||
tempReadme.md | ||
src/yatter/__pycache__/termmap.cpython-311.pyc | ||
src/yatter/__pycache__/target.cpython-311.pyc | ||
src/yatter/__pycache__/subject.cpython-311.pyc | ||
src/yatter/__pycache__/source.cpython-311.pyc | ||
src/yatter/__pycache__/predicateobject.cpython-311.pyc | ||
src/yatter/__pycache__/normalization.cpython-311.pyc | ||
src/yatter/__pycache__/mapping.cpython-311.pyc | ||
src/yatter/__pycache__/graph.cpython-311.pyc | ||
src/yatter/__pycache__/function.cpython-311.pyc | ||
src/yatter/__pycache__/constants.cpython-311.pyc | ||
src/yatter/__pycache__/__main__.cpython-311.pyc | ||
src/yatter/__pycache__/__init__.cpython-311.pyc | ||
src/yatter/__init__.py | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this ignored? |
||
test/normalize/NORMKEYS-01/mapping_normalized.yml | ||
test/normalize/NORMKEYS-01/mapping.yml | ||
mapping.rml.ttl | ||
test/rml-io/YARRRMLTC-0036/__pycache__/test_yarrrmltc0036.cpython-311-pytest-8.3.3.pyc | ||
*.pyc | ||
/src/outputNEW.ttl |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[tool.poetry] | ||
name = "yatter" | ||
version = "1.1.4" | ||
description = "The tool translates mapping rules from YARRRML in a turtle-based serialization of RML or R2RML." | ||
authors = ["David Chaves <[email protected]>", "Rubén Buján <[email protected]>"] | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.8" | ||
ruamel-yaml = "^0.17.21" | ||
rdflib = "^6.2.0" | ||
coloredlogs = "^15.0.1" | ||
|
||
[tool.poetry.group.test.dependencies] | ||
pytest = "^8.3.3" | ||
setuptools = "^75.1.0" | ||
wheel = "^0.44.0" | ||
DeepDiff = "^8.0.1" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,7 +110,6 @@ | |
|
||
YARRRML_PREFIXES = 'prefixes' | ||
YARRRML_SOURCES = 'sources' | ||
YARRRML_SOURCE = 'source' | ||
YARRRML_TABLE = 'table' | ||
YARRRML_ACCESS = 'access' | ||
YARRRML_QUERY = 'query' | ||
|
@@ -124,35 +123,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_AUTHORS = 'authors' | ||
YARRRML_GRAPHS = 'graphs' | ||
YARRRML_GRAPH = 'graph' | ||
YARRRML_GRAPH_SHORTCUT = 'g' | ||
|
||
YARRRML_PREDICATEOBJECT = 'predicateobjects' | ||
YARRRML_PREDICATEOBJECT_SHORTCUT = 'po' | ||
YARRRML_PREDICATEOBJECT_SHORTCUT = 'po' #eliminar | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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' | ||
|
@@ -166,22 +155,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 = { | ||
|
@@ -226,4 +212,4 @@ | |
} | ||
|
||
logger = logging.getLogger(__name__) | ||
coloredlogs.install(level='DEBUG', fmt='%(asctime)s,%(msecs)03d | %(levelname)s: %(message)s') | ||
coloredlogs.install(level='DEBUG', fmt='%(asctime)s,%(msecs)03d | %(levelname)s: %(message)s') |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,8 +140,14 @@ def generate_extended_join(yarrrml_data): | |
for value in equals: | ||
parameters = [] | ||
conditions = value.replace("(","",1).rsplit(")",1)[0].split(",") | ||
parameters.append(['str1',conditions[0]]) | ||
parameters.append(['str2', conditions[1]]) | ||
expanded_param = dict() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe this can be done in one or two lines? |
||
expanded_param[YARRRML_PARAMETER] = 'str1' | ||
expanded_param[YARRRML_VALUE] = conditions[0] | ||
parameters.append(expanded_param) | ||
expanded_param = dict() | ||
expanded_param[YARRRML_PARAMETER] = 'str2' | ||
expanded_param[YARRRML_VALUE] = conditions[1] | ||
parameters.append(expanded_param) | ||
extended_join[YARRRML_CONDITION].append({YARRRML_FUNCTION: YARRRML_EQUAL, YARRRML_PARAMETERS: parameters}) | ||
|
||
return extended_join | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be removed, just add src/yatter/pycache