Conditions in PEARL

16 views
Skip to first unread message

jesper e

unread,
Sep 24, 2025, 8:05:47 AM (8 days ago) Sep 24
to vocbench-user
Hello everyone

Potentially very simple problem here - we are trying to figure out how to create a condition in PEARL. I have provided a simple example rule below: 

rule it.uniroma2.art.Sheet2RDFAnnotation id:row {
nodes = {
cs uri(coda:formatter("%s", "https://data.stat.ee/cat/code_cs")).
code literal col_0/value .
        @Memoized
codeRes uri(coda:formatter("%s%s", "https://data.stat.ee/cat/code#", $code )) col_0/value .
parentCode literal col_1/value .
@Memoized
parentCodeRes uri(coda:formatter("%s%s", "https://data.stat.ee/cat/code#", $parentCode )) col_1/value .
}

insert = {
OPTIONAL{
$codeRes skos:topConceptOf $cs .
}
}
}

In this rule, every row's code is made into an URI (assigned codeRes) and then made top concept of the Concept Scheme cs. We would like to know how the insertion can be made conditional - for example, it is inserted ONLY when the parentCode (col_1/value) in that row is empty, or perhaps with value '1'?

We tried referring to PEARL documentation and looking into conditions, where clause, etc. but had no luck.

Thanks in advance.

Roland Wingerter

unread,
Sep 25, 2025, 11:15:29 AM (7 days ago) Sep 25
to vocbench-user
Hi Jesper,

Check out the thread "Sheet2Rdf : conditional skos:topConceptOf"According to Armando Stellato, currently it is not possible to test for an empty cell in Pearl, but you can try the workaround he suggested. Hope it helps.

Kind regards
Roland
Reply all
Reply to author
Forward
0 new messages