Skip to content

Conditions for a resource to exist #2

@pietercolpaert

Description

@pietercolpaert

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
] .

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions