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

Predicate cannot be referenced from data #186

Open
Melchyore opened this issue Feb 16, 2023 · 3 comments
Open

Predicate cannot be referenced from data #186

Melchyore opened this issue Feb 16, 2023 · 3 comments

Comments

@Melchyore
Copy link

Issue type: 🐛 Bug

Description

Hi, i want to reference a predicate from the data, but it causes the following error: Cannot read properties of undefined (reading '@id'). I think the predicate needs to be explicitly set but there isn't a way to reference it from the data?

Steps

Yarrrml (not working version)

prefixes:
    odrl: http://www.w3.org/ns/odrl/2/
    xsd: http://www.w3.org/2001/XMLSchema#
    rdfs: http://www.w3.org/2000/01/rdf-schema#
    rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#

mappings:
  policy:
    sources:
      - [input~csv]
    s: $(uid)
    po:
      - [a, $(type)~iri]
      - [$(rule), ex:test~iri]

Yarrrml (working version)

prefixes:
    odrl: http://www.w3.org/ns/odrl/2/
    xsd: http://www.w3.org/2001/XMLSchema#
    rdfs: http://www.w3.org/2000/01/rdf-schema#
    rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#

mappings:
  policy:
    sources:
      - [input~csv]
    s: $(uid)
    po:
      - [a, $(type)~iri]
      - [odrl:permission, ex:test~iri]

Data

type,uid,rule
http://www.w3.org/ns/odrl/2/Agreement,https://example.com/agreement_01,http://www.w3.org/ns/odrl/2/permission

Environment

Windows 10
Latest version of this package

Thank you!

@Melchyore Melchyore changed the title Predicate cannot be set from data Predicate cannot be referenced from data Feb 16, 2023
@bjdmeest
Copy link
Collaborator

Hmmm, weird, when trying it on Matey (yarrrml-parser v1.3.3), your example works. I don't see a reason why v1.4.0 would give an error, but we'll have a look. In the meantime, could you maybe check on your side whether v1.3.3 does work for you? If so, we found a new test case! :D

@Melchyore
Copy link
Author

Melchyore commented Feb 17, 2023

I tried with v1.3.3 and had the same problem. I'm using this lib to create RML rules that are then used by RocketRML to generate RDF. The problem comes from RocketRML's lib and I've already opened the same issue in their repo 2 weeks ago then after some investigation, I tought that the bug is caused by yarrrml-parser (yesterday), but I was wrong! I apologize for the inconvenience. This is the exact issue: comake/rmlmapper-js#6 (comment)

Do you know any other alternatives (in JS/TS, without using any JAR) to generate RDF from YARRRML templates (that support referenced predicates values), please?

@bjdmeest
Copy link
Collaborator

bjdmeest commented Mar 6, 2023

I don't know about any other alternatives except for RocketRML and RMLMapper-JS, but you could ask at https://github.com/kg-construct/rml-questions/discussions to ask the wider community! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants