Skip to content
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

BUG: RML-star - multiple predicate-object-mappings not recognised in base of 2nd-level deeply nested triples #174

Closed
pawelostr opened this issue Jun 9, 2023 · 8 comments
Assignees
Labels
bug Something isn't working rml-star

Comments

@pawelostr
Copy link
Contributor

pawelostr commented Jun 9, 2023

What Happens?

See #174 (comment)

When attempting to generate any kind of 2nd level quote the engine fails (producing no double quoted triples most of the time, in some cases there will be one triple generated).

To Reproduce

Use the files in following Gist mapping and data source - this is an example adopted from RML-star spec, where no 2nd level quoted triples are generated.
Same problem happens with XML files and appropiate mappings.

Environment (please complete the following information):

  • OS: macOS 13.4
  • Python version: 3.11
  • Morph-KGC version: 2.4.0 and 2.5.1
@pawelostr pawelostr added the bug Something isn't working label Jun 9, 2023
@arenas-guerrero-julian
Copy link
Member

Hi @pawelostr ,

I just tried your example with Morph-KGC v 2.4.0 and with the latest version available in the repository and it is working correctly generating all the triples. I am on Ubuntu. CI test cases pass on python 3.11 and MacOS.

I wonder if it could be your MacOS version. Please try on another OS.

Julián

@pawelostr
Copy link
Contributor Author

pawelostr commented Jun 12, 2023

Hi Julián,

So I've tried the mappings on Windows 11 22H2 with Python 3.9.13 and in Google Colab, and unfortunatelly the result it still the same - no triples from <#outerTriplesMap> are generated.

Below is a script for Colab, in which exactly 0 triples are generated, as to exacerbate the problem I've switched <#innerTriplesMap> and <#middleTriplesMap> to rml:NonAssertedTriplesMap.

!pip install morph-kgc
!git clone https://gitlab.com/pawelostr/rdf-star-animals.git
!echo "[Something]" > /content/rdf-star-animals/config-temp.ini
!echo "mappings=animals.ttl" >> /content/rdf-star-animals/config-temp.ini
!cd /content/rdf-star-animals && python3 -m morph_kgc config-temp.ini

On a side note, I've tried almost every combination of NonAssertedTriplesMap, AssertedTriplesMap, TriplesMap, and all the combinations of prefixes from RML and R2RML to no avail.

Edit: So I also tested it on up-to-date Arch with python 3.11.3 in conda env on 2.5.1, and again only inner and mid triples are generated.

@arenas-guerrero-julian
Copy link
Member

Hi @pawelostr ,

I tried again and it is working.

Julián

@anaigmo
Copy link

anaigmo commented Jun 15, 2023

Hi @pawelostr, @arenas-guerrero-julian,

I've tried with the example provided and it is a mistake in the mapping, morph works fine. With the attached mapping and v2.6.0 I get as result nested quoted triples.

animals-test-rmlstar.zip

@arenas-guerrero-julian
Copy link
Member

Thanks for checking this @anaigmo

@pawelostr
Copy link
Contributor Author

pawelostr commented Jun 15, 2023

Hey @anaigmo @arenas-guerrero-julian,

There was indeed an error in my original example, as I've mixed some old and new stuff, and @anaigmo 's works in both 2.5.1 and 2.6.0.

For posteriority I'll leave a modified one that's fully on rml prefix http://w3id.org/rml/, that's cohesive with morph rml-star test cases as of 2.6.0.

animals-full-rml.ttl.txt

pawelostr added a commit to pawelostr/morph-kgc that referenced this issue Jun 16, 2023
arenas-guerrero-julian added a commit that referenced this issue Jun 21, 2023
@arenas-guerrero-julian
Copy link
Member

This issue is related to #124

@pawelostr pawelostr changed the title BUG: Deeply nested quotes are not generated BUG: RML-star - multiple predicate-object-mappings not recognised in base of 2nd-level deeply nested triples Jun 21, 2023
@pawelostr
Copy link
Contributor Author

pawelostr commented Jun 21, 2023

Unfortunately the original diagnosis (#174 (comment)) was wrong, and uploaded example mapping was not representative of the issue at hand.

(producing no double quoted triples most of the time, in some cases there will be one triple generated)

only the second part is the problem, first is a problem of incorrect mappings that have been created during attemps at diagnosis of the bug.

What Happens?

If a second level of deeply nested quoted triples is attempted to be generated (<< << < s p o > p1 o1 >> p2 o2 >>) and there's more than one predicateObjectMap (whether as a predicateObjectMap or as a class in subjectMap) in a base (the < s p o >) AssertedTriplesMap or NonAssertedTriplesMap, only one triple is generated.

To Reproduce

Run test/issues/issue_174 (tests a and b will fail, c will pass) on a pre-pull request no 177 (<=2.6.0) morph-kgc.

Resolution

Pull request no. 177 fixes described problem and 178 adds additional tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working rml-star
Projects
None yet
Development

No branches or pull requests

3 participants