Mahmood Ahmad
2016-11-04 11:33:16 UTC
Hi,
Is there a way to control the output graph generated by the CONSTRUCT query? I know FILTER is one such option with NOT EXISTS.
The example output that I get in Apache Jena Fuseki 2.4.0 (used on Windows 10) is like below that I get in Turtle format:
"<http://www.xyz.com#UUID>"
skos:prefLabel "Preferred Label" ;
skos:broader "Broader entity";
a:aCode "Some Code" ;
a:aLevel "Some Level" ;
skos:narrower "Some narrower entity" .
If I don't like to have certain properties not to be displayed in the output graph, I tried to use NOT EXISTS in the FILTER option as follows:
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix a: <http://www.xyz.com/vocab#>
CONSTRUCT {
?snew skos:prefLabel ?pl ;
skos:broader ?b ;
a:aCode ?ac ;
?p ?o .
}
WHERE
{
?olds skos:prefLabel ?pl ;
skos:broader ?b ;
a:aCode ?ac ;
?p ?o .
BIND(CONCAT(CONCAT(STRBEFORE(STR(?olds), "#"), "#"), STRUUID()) AS ?snew) .
FILTER NOT EXISTS { ?snew a:aLevel ?le ;
?snew skos:narrower ?na ;
?p ?o . }
}
I have tried this with trying to exclude only one of the unwanted properties. I have also tried this with MINUS, without success. The output generated has no effect.
Any way out on this? I'll appreciate!
Regards
Mahmood
================================================
Dr Mahmood Ahmad
KTP Associate
School of Computer Science
University of Manchester
and
Telematicus
Newport Street
Macclesfield
SK11 6QJ
United Kingdom
E: ***@telematicus.com<mailto:***@telematicus.com>
E: ***@manchester.ac.uk<mailto:***@manchester.ac.uk>
Is there a way to control the output graph generated by the CONSTRUCT query? I know FILTER is one such option with NOT EXISTS.
The example output that I get in Apache Jena Fuseki 2.4.0 (used on Windows 10) is like below that I get in Turtle format:
"<http://www.xyz.com#UUID>"
skos:prefLabel "Preferred Label" ;
skos:broader "Broader entity";
a:aCode "Some Code" ;
a:aLevel "Some Level" ;
skos:narrower "Some narrower entity" .
If I don't like to have certain properties not to be displayed in the output graph, I tried to use NOT EXISTS in the FILTER option as follows:
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix a: <http://www.xyz.com/vocab#>
CONSTRUCT {
?snew skos:prefLabel ?pl ;
skos:broader ?b ;
a:aCode ?ac ;
?p ?o .
}
WHERE
{
?olds skos:prefLabel ?pl ;
skos:broader ?b ;
a:aCode ?ac ;
?p ?o .
BIND(CONCAT(CONCAT(STRBEFORE(STR(?olds), "#"), "#"), STRUUID()) AS ?snew) .
FILTER NOT EXISTS { ?snew a:aLevel ?le ;
?snew skos:narrower ?na ;
?p ?o . }
}
I have tried this with trying to exclude only one of the unwanted properties. I have also tried this with MINUS, without success. The output generated has no effect.
Any way out on this? I'll appreciate!
Regards
Mahmood
================================================
Dr Mahmood Ahmad
KTP Associate
School of Computer Science
University of Manchester
and
Telematicus
Newport Street
Macclesfield
SK11 6QJ
United Kingdom
E: ***@telematicus.com<mailto:***@telematicus.com>
E: ***@manchester.ac.uk<mailto:***@manchester.ac.uk>