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

Supporting conditionals rules #80

Open
jatoledo opened this issue Mar 6, 2024 · 2 comments
Open

Supporting conditionals rules #80

jatoledo opened this issue Mar 6, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request new-feature petition for new feature support pending

Comments

@jatoledo
Copy link

jatoledo commented Mar 6, 2024

Error translating functions in RML at the PO level.

yarrrml mapping:

prefixes:
  grel: http://users.ugent.be/~bjdmeest/function/grel.ttl#
  idlab-fn: http://example.com/idlab/function/

mappings:
  person:
    sources:
     - [test.csv~csv]
    subject: http://example.org/$(firstname)
    predicateobjects:
     - predicates: foaf:firstName
       objects: $(firstname)
       condition:
        function: idlab-fn:equal
        parameters:
         - [grel:valueParameter, $(firstname)]
         - [grel:valueParameter2, "test"]

How is connected the TMP <person_0> with the function <function_person_0> ?

@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#>.
@prefix idlab-fn: <http://example.com/idlab/function/>.
@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix rml: <http://semweb.mmlab.be/ns/rml#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix ql: <http://semweb.mmlab.be/ns/ql#>.
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix schema: <http://schema.org/>.
@prefix formats: <http://www.w3.org/ns/formats/>.
@prefix comp: <http://semweb.mmlab.be/ns/rml-compression#>.
@prefix void: <http://rdfs.org/ns/void#>.
@prefix fnml: <http://semweb.mmlab.be/ns/fnml#>.
@base <http://example.com/ns#>.


<function_person_0> a fnml:Execution;
	fnml:function idlab-fn:equal ; 
	fnml:input
		[
			a fnml:Input;
			fnml:parameter grel:valueParameter;
			fnml:valueMap [
				a fnml:ValueMap;
				rml:reference "firstname";
			];
		],
		[
			a fnml:Input;
			fnml:parameter grel:valueParameter2;
			fnml:valueMap [
				a fnml:ValueMap;
				rr:constant "test";
			];
		].

<person_0> a rr:TriplesMap;

	rml:logicalSource [
		a rml:LogicalSource;
		rml:source "test.csv";
		rml:referenceFormulation ql:CSV
	];
	rr:subjectMap [
		a rr:SubjectMap;
		rr:template "http://example.org/{firstname}";
	];
	rr:predicateObjectMap [
		rr:predicateMap [
			a rr:PredicateMap;
			rr:constant foaf:firstName;
		];
		rr:objectMap [
			a rr:ObjectMap;
			rml:reference "firstname";
		];
	].



Version:
yatter: 1.1.2

@dachafra
Copy link
Member

dachafra commented Mar 7, 2024

@jatoledo this is a conditional generation of the triples, which is not part of any RML spec. That's why it's not supported in Yatter. You can proceed as follows:

  1. Propose to include conditionals in RML at the CG (kg-construct))
  2. I know that this behavior was included in the YARRRML spec, and I asked for the corresponding translation to RML (bc in the spec is not provided), see Provide RML-FNML translation for conditions kg-construct/yarrrml-spec#2

@dachafra dachafra added enhancement New feature or request new-feature petition for new feature support labels Mar 7, 2024
@dachafra dachafra changed the title Error translating functions in RML at the PO level Supporting conditionals rules Mar 7, 2024
@dachafra
Copy link
Member

dachafra commented Mar 7, 2024

This is not going to be implemented until the spec of YARRRML provides actual examples on how to do the proper translation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new-feature petition for new feature support pending
Projects
None yet
Development

No branches or pull requests

2 participants