Hi,

This query does what i want, that is, lists all graphs having the term "digitalisaatio"@fi:

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
SELECT ?s ?graphTitle1  ?graphTitle2
WHERE {
GRAPH ?graph
{
        ?s skos:prefLabel "digitalisaatio"@fi

        OPTIONAL { ?graph dcterms:title ?graphTitle1 }
}}



But when I add new param
OPTIONAL { ?graph dc:title ?graphTitle2}

so that new query is this:
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
SELECT ?s ?graphTitle1  ?graphTitle2
WHERE {
GRAPH ?graph
{
        ?s skos:prefLabel "digitalisaatio"@fi

        OPTIONAL { ?graph dcterms:title ?graphTitle1 }
        OPTIONAL { ?graph dc:title ?graphTitle2}
}}

I dont get all the graphs anymore. OPTIONAL should never filter out data, just add? There must be a logical explanation, but I'm not getting it. Im using Fuseki.

Br,
Mikael

--
www.lingsoft.fi

Speech Applications - Language Management - Translation - Reader's and Writer's 
Tools - Text Tools - E-books and M-books

Mikael Pesonen
System Engineer

e-mail: mikael.peso...@lingsoft.fi
Tel. +358 2 279 3300

Time zone: GMT+2

Helsinki Office
Eteläranta 10
FI-00130 Helsinki
FINLAND

Turku Office
Linnankatu 10 A
FI-20100 Turku
FINLAND

Reply via email to