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

inverse predicates in RML #40

Open
pmaria opened this issue Oct 11, 2021 · 8 comments
Open

inverse predicates in RML #40

pmaria opened this issue Oct 11, 2021 · 8 comments

Comments

@pmaria
Copy link
Collaborator

pmaria commented Oct 11, 2021

An aspect missing from RML is the ability to generate a triple using an inverse predicate.

Specifiying the generation of triples with an inverse predicate would allow you to generate a triple in the inverse direction so object -> predicate -> subject in the context of the subject generating triples map.

Note: YARRRML also introduces inverse predicates.

Proposal:

  • Add a new construct rml:InversePredicateMap which is a term map that can be referenced from a rml:PredicateObjectMap using rml:inversePredicateMap.
  • Add a shortcut property rml:inversePredicate for rml:inversePredicateMap, analogous to rr:predicate.
  • Redefine rml:PredicateObjectMap such that it should have at least one rml:PredicateMap or rml:InversePredicateMap. This will allow for maximum flexibility in use.
  • Restrict the allowed term type of an rml:ObjectMap that is referenced by a rml:PredicateObjectMap which also rererences an rml:InversePredicateMap to IRIs and blank nodes.

Example:

<someTriplesMap>
  rml:logicalSource [] ;
  rr:subject ex:subject ;
  rr:predicateObjectMap [
    rr:predicateMap [
      rr:constant ex:parent ;
    ] ;
    rml:inversePredicateMap [
      rr:constant ex:child ;
    ] ;
    rr:object ex:object ;
  ] ;

or using shortcut properties:

<someTriplesMap>
  rml:logicalSource [] ;
  rr:subject ex:subject ;
  rr:predicateObjectMap [
    rr:predicate ex:parent ;
    rml:inversePredicate ex:child;
    rr:object ex:object ;
  ] ;

would generate:

ex:subject ex:parent ex:object .

ex:object ex:child ex:subject .
@dachafra dachafra added documentation Improvements or additions to documentation RML-core issue related to the core part of the RML vocab RML-core-extension labels Mar 27, 2022
@dachafra dachafra added proposal issue has a proposal to be solved and removed RML-core-extension labels Mar 28, 2022
@andimou
Copy link
Contributor

andimou commented Apr 6, 2022

Overall I agree with this, but isn't it more a core issue rather than an fno issue?

Only a clarification, with the following

Redefine rml:PredicateObjectMap such that it should have at least one rml:PredicateMap or rml:InversePredicateMap. This will allow for maximum flexibility in use.

you mean we can have a POM which only has an inverse predicate map but not a regular predicate map? or do you see more flexibility than this?

@pmaria
Copy link
Collaborator Author

pmaria commented Apr 6, 2022

Overall I agree with this, but isn't it more a core issue rather than an fno issue?

Agreed, but we don't have a separate repository for core yet as far as I know.

you mean we can have a POM which only has an inverse predicate map but not a regular predicate map? or do you see more flexibility than this?

Indeed, that is exactly what I meant.

@DylanVanAssche
Copy link
Collaborator

I like this! Implementation-wise this should be straightforward as well, no additional complexity.

@dachafra
Copy link
Member

dachafra commented Jul 3, 2024

This is a very old issue and I don't know if we will implement or leave it for the Working Group. I'd like to hear opinions from @andimou @pmaria @DylanVanAssche @anaigmo

@DylanVanAssche
Copy link
Collaborator

I would like to see this, but depends on RML-Core to add it to the spec. Also needs test cases and SHACL shapes of course.

@dachafra dachafra removed documentation Improvements or additions to documentation RML-core issue related to the core part of the RML vocab proposal issue has a proposal to be solved labels Jul 3, 2024
@dachafra
Copy link
Member

dachafra commented Jul 3, 2024

IMHO, I would mark it as working-group and not implement this for the CG

@pmaria
Copy link
Collaborator Author

pmaria commented Jul 3, 2024

We can leave it on working group, unless I have time to add it beforehand :)

@idomingu
Copy link

idomingu commented Jul 4, 2024

This feature would come handy. I support it, unless it adds extra complexity in the RML engine.

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

No branches or pull requests

5 participants