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

Conditions for a resource to exist #2

Open
pietercolpaert opened this issue Oct 27, 2013 · 0 comments
Open

Conditions for a resource to exist #2

pietercolpaert opened this issue Oct 27, 2013 · 0 comments
Assignees
Labels

Comments

@pietercolpaert
Copy link
Member

This issue applies mainly to Vertere, although the question may be asked whether we should also support this in RML /cc @andimou

For example, a file called "relations.csv"

subject,object,predicate,value
pointA,pointB,distance,5
pointA,pointC,sameAs,

We could now map each line to different resources by making certain resources only exist if a certain condition is met. For instance if we want to create a new distance resource if there is "distance" in column "predicate", then this could work:

<#Distance> a :Resource
; :identity [
    :source_columns ("subject" "object");
    :source_column_glue "/" ;
    :base_uri "http://foo.bar/distance/" # this will result in distance/{subject}/{object}
]
; :condition [
    a :ExistsCondition;
    :exist ( "subject" "object" );
]
,[ 
    a :MatchCondition;
    :source_column "predicate";
    :value "distance";
    :flags "i" #follows the preg_match PHP method flags
] .
@ghost ghost assigned pietercolpaert Oct 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant