Giter VIP home page Giter VIP logo

scaseco / r2-rml-toolkit Goto Github PK

View Code? Open in Web Editor NEW
3.0 8.0 0.0 1.28 MB

A modular R2RML suite built on Apache Jena. Featuring a complete domain API built on Jena's polymorphism system, SHACL validation, an R2RML processor with 100% standard conformance based an Jena's ARQ plus common tooling every R2RML project needs.

License: Other

Java 99.55% Makefile 0.21% Shell 0.24%
r2rml apache-jena semantic-web rdb2rdf r2rml-api-jena jena-arq

r2-rml-toolkit's People

Contributors

aklakan avatar simonbin avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

r2-rml-toolkit's Issues

Incorrect SPARQL Exprs when joining TriplesMaps with different reference formulations

The TriplesMapProcessorRml incorrectly resolves all expressions against a RefObjectMap's child context .
If the child of a join uses JSON and the parent uses XML then json functions will be applied to the XML data:

[] <http://semweb.mmlab.be/ns/rml#source>  "/data/shared/STOPS.xml" ;
   <https://w3id.org/aksw/norse#rml.output>  ?s2}
BIND(<https://w3id.org/aksw/norse#json.get>(?s2, "stop_id") AS ?jc0)

GitFlow and RPM plugin incompatibility

It seems that this is a conflict between the gitflow and the rpm plugin (or at least the latter's configurations).
Disabling the rpm causes normal termination of mvn gitflow:release-finish.

[ERROR] 
org.apache.maven.plugin.MojoFailureException: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

    at com.amashchenko.maven.plugin.gitflow.AbstractGitFlowMojo.executeCommand (AbstractGitFlowMojo.java:963)
    at com.amashchenko.maven.plugin.gitflow.AbstractGitFlowMojo.executeMvnCommand (AbstractGitFlowMojo.java:905)
    at com.amashchenko.maven.plugin.gitflow.AbstractGitFlowMojo.mvnCleanTest (AbstractGitFlowMojo.java:824)

Packages are getting deployed

mvn clean install deploy
results in:

[INFO] rmltk-pkg-deb-cli .................................................................................... FAILURE [  0.527 s]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:3.3.0:jar (default-jar) on project rmltk-pkg-deb-cli: You have to use a classifier to attach supplemental artifacts to the project instead of replacing them. -> [Help 1]

The error occasionally appears in other projects, so investigating the culprit for it is worthwhile.
But for this project, packages (debian, rpm, uberjar) should not be deployed in the first place.

Revise model for filters on term maps

The current internal model for RML to SPARQL translation does not handle term maps and their corresponding lateral blocks as first class citizens, such that filters on term maps can not yet be easily translated. A revision of the internal model and the translation procedure is needed:

Example: Given the following term map:

 rr:predicateObjectMap [
      rr:predicate coy:hasAssetId;
      rr:objectMap [
        rml:reference "asset_id";
        rr:datatype xsd:string ;
        norse:rml.filter "?asset_id != ''" ; # filter out empty column
      ]
    ] ;

In the RML-to-SPARQL translation, RML term maps should be be translated to their own SPARQL LATERAL blocks, as sketched below:

  logicalSource
  LATERAL {
        { FILTER(?asset_id != '') BIND(?asset_id AS ?allocatedTermMapVar) }
      UNION
        { ... }
  }

Note, that filters on the logical source just drop bindings of that source, so on that level the current model shouldn't have much problems.

RML to SPARQL should support adding prefixes to sparql queries

There are the following ways forhow this can be handled and appropriate configuration options should be provided:

  • repeat prefixes on every query (gets ugly when many prefixes are involved)
  • only add the prefixes to the beginning of a file containing sparql queries (our parser can handle this, but probably less portable)

For the CLI, in addition it may be worthwhile to add an option that outputs each query to a separate file.

Nexus staging plugin error (probably its version is too old)

master$ mvn -P release clean install deploy

results in:

[ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy (injected-nexus-deploy) on project rmltk-bom: Execution injected-nexus-deploy of goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy failed: An API incompatibility was encountered while executing org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy: java.lang.ExceptionInInitializerError: null

predicateObjectMap - subject and object are interchanged

In my mapping.ttl I have:

<TradeInValueAdded> a rr:TriplesMap;

    rml:logicalSource [
        rml:source "./trade.csv" ;
        rml:referenceFormulation ql:CSV
    ];

    rr:subjectMap [
        rr:template "https://data.coypu.org/trade/baci/{id}/{i}_{j}_value" ;
        rr:class tiva:ExgrDva
    ];

    rr:predicateObjectMap [
        rr:predicate tiva:hasTrade ;
        rr:objectMap [
            rr:parentTriplesMap <Trades>;
            rr:joinCondition [
                rr:child "id";
                rr:parent "id"
            ]
           ]
    ];

    rr:predicateObjectMap [
        rr:predicate tiva:hasImport ;
        rr:objectMap [
            rr:parentTriplesMap <Countries>;
            rr:joinCondition [
                rr:child "j";
                rr:parent "country_code"
            ]
           ]
    ];

    rr:predicateObjectMap [
        rr:predicate tiva:hasExport;
        rr:objectMap [
            rr:parentTriplesMap <Countries>;
            rr:joinCondition [
                rr:child "i";
                rr:parent "country_code"
            ]
           ]
    ]
    .

and after transforming it to sparql the subject and object are interchanged:

CONSTRUCT 
  { 
    ?v12 <https://schema.coypu.org/vtf#hasTrade> ?v10 .
  }
WHERE
  { SERVICE <https://w3id.org/aksw/norse#rml.source>
      { <https://w3id.org/aksw/norse#rml.source>
                  <http://semweb.mmlab.be/ns/rml#source>  "./trade.csv" ;
                  <http://semweb.mmlab.be/ns/rml#referenceFormulation>  <http://semweb.mmlab.be/ns/ql#CSV> ;
                  <https://w3id.org/aksw/norse#rml.output>  ?s0}
    BIND(encode_for_uri(str(<https://w3id.org/aksw/norse#json.get>(?s0, "id"))) AS ?v2)
    BIND(IRI(concat("https://data.coypu.org/trade/baci/", ?v2)) AS ?v12)
    BIND(IRI(concat("https://data.coypu.org/trade/baci/", ?v2, "/", encode_for_uri(str(<https://w3id.org/aksw/norse#json.get>(?s0, "i"))), "_", encode_for_uri(str(<https://w3id.org/aksw/norse#json.get>(?s0, "j"))), "_value")) AS ?v10)
  }

also after optimizing:

CONSTRUCT 
  { 
    GRAPH ?__g__ 
      { ?__s__ ?__p__ ?__o__ .}
  }
WHERE
  { SELECT  (<urn:x-arq:DefaultGraphNode> AS ?__g__) ?__s__ (<https://schema.coypu.org/vtf#hasTrade> AS ?__p__) ?__o__
    WHERE
      { SELECT DISTINCT  (?m0_v12 AS ?__s__) (?m0_v10 AS ?__o__)
        WHERE
          { SERVICE <https://w3id.org/aksw/norse#rml.source>
              { <https://w3id.org/aksw/norse#rml.source>
                          <http://semweb.mmlab.be/ns/rml#source>  "./trade.csv" ;
                          <http://semweb.mmlab.be/ns/rml#referenceFormulation>  <http://semweb.mmlab.be/ns/ql#CSV> ;
                          <https://w3id.org/aksw/norse#rml.output>  ?s0}
            BIND(encode_for_uri(str(<https://w3id.org/aksw/norse#json.get>(?s0, "id"))) AS ?m0_v2)
            BIND(IRI(concat("https://data.coypu.org/trade/baci/", ?m0_v2)) AS ?m0_v12)
            BIND(IRI(concat("https://data.coypu.org/trade/baci/", ?m0_v2, "/", encode_for_uri(str(<https://w3id.org/aksw/norse#json.get>(?s0, "i"))), "_", encode_for_uri(str(<https://w3id.org/aksw/norse#json.get>(?s0, "j"))), "_value")) AS ?m0_v10)
          }
      }
  }

The data then has the wrong triple:

<https://data.coypu.org/trade/baci/1> <https://schema.coypu.org/vtf#hasTrade> <https://data.coypu.org/trade/baci/1/4_24_value> .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.