Giter VIP home page Giter VIP logo

example-yarrrml-rules's Introduction

YARRRML Example rules

This repository contains example YARRRML rules to generate Linked Data

  • dbpedia_spotlight: when using DBpedia Spotlight
  • facebook: mapping your Facebook data
  • multiple_conditions: joining 2 mappings based on multiple conditions (logical AND by default)
  • twitter: mapping your Twitter data

License

This code is copyrighted by Ghent University โ€“ imec and released under the MIT license.

example-yarrrml-rules's People

Contributors

bjdmeest avatar pheyvaer avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

example-yarrrml-rules's Issues

Unexpected characters error with XPath predicates

I have an example.xml file like this:

<people>
    <person id="I100194341916">
        <name>
            <nameForm>
                <part type="Given" value="Robert"/>
                <part type="Surname" value="Walpole"/>
            </nameForm>
        </name>
    </person>
</people>

and a YARRRML file like this:

prefixes:
  ex: http://example.org/
mappings:
  people:
    sources:
      - ['example.xml~xpath','/people/person']
    s: ex:person.$(@id)
    po:
      - [a, foaf:Person]
      - [foaf:givenName, $(name/nameForm/part[@type='Given']/@value)] 

When I try to parse the YARRRML I get an error:

line 8: Unexpected characters near "/@value)]".

However if I remove the XPath predicate [@type='Given'] from the YARRRML and then modify the generated RML to re-add the predicate as follows:

:om_001 a rr:ObjectMap;
    rml:reference "name/nameForm/part[@type='Given']/@value";
    rr:termType rr:Literal.

Then the mapping works as expected.

Any thoughts on this please?

WIP: Make example with a nested condition

TODO: I still need to test this

myMapping:
    sources:
      - ["data.csv~csv"]
    s: http://example.com#$(ID)
    po:
      - p: ex:relation
        o:
          - mapping: myOtherMapping # Just and example
            condition:
              function: grel:boolean_and
              parameters:
                - parameter: grel:param_rep_b
                  value:
                    function: equal
                      parameters:
                        - [str1, "$(myId)"]
                        - [str2, "$(myOtherId)"]
                - parameter: grel:param_rep_b
                  value:
                    function: equal
                      parameters:
                        - [str1, "$(myName)"]
                        - [str2, "$(myOtherName)"]

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.