I'm running the same SPARQL Query on apache-jena-2.11.1 (eclipse 64jvm), Protégé and TopBraid Composer (free edition).
Jena returns an empty set while both Protégé and TopBraid Composer return/find the correct results.
The SPARQL Query:
PREFIX core: <http://www.linked-usdl.org/ns/usdl-core#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX price: <http://www.linked-usdl.org/ns/usdl-price#>
PREFIX pf: <http://jena.hpl.hp.com/ARQ/property#>
PREFIX spin: <http://spinrdf.org/spin#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX gr: <http://purl.org/goodrelations/v1#>
PREFIX cloudtaxonomy: <http://rdfs.genssiz.org/CloudTaxonomy#>
SELECT REDUCED ?offering
WHERE
{ { SELECT REDUCED ?offering
WHERE
{ ?offering rdf:type core:ServiceOffering .
?offering core:includes ?serv
{ ?serv gr:qualitativeProductOrServiceProperty ?f .
?f rdf:type cloudtaxonomy:Location .
?f rdfs:label ?value
FILTER REGEX(?value, "tokyo", "i")
}
UNION
{ ?serv core:hasServiceModel ?model .
?model gr:qualitativeProductOrServiceProperty ?f .
?f rdf:type cloudtaxonomy:Location .
?f rdfs:label ?value
FILTER REGEX(?value, "tokyo", "i")
}
}
}
{ SELECT REDUCED ?offering
WHERE
{ ?offering rdf:type core:ServiceOffering .
?offering core:includes ?serv
{ ?serv gr:quantitativeProductOrServiceProperty cloudtaxonomy:MemorySize .
?f gr:hasValue ?value
FILTER ( ?value >= 3.7 )
}
UNION
{ ?serv gr:quantitativeProductOrServiceProperty ?f .
?f rdf:type cloudtaxonomy:MemorySize .
?f gr:hasValue ?value
FILTER ( ?value >= 3.7 )
}
UNION
{ ?serv core:hasServiceModel ?model .
?model gr:quantitativeProductOrServiceProperty cloudtaxonomy:MemorySize .
?f gr:hasValue ?value
FILTER ( ?value >= 3.7 )
}
UNION
{ ?serv core:hasServiceModel ?model .
?model gr:quantitativeProductOrServiceProperty ?f .
?f rdf:type cloudtaxonomy:MemorySize .
?f gr:hasValue ?value
FILTER ( ?value >= 3.7 )
}
UNION
{ ?serv core:hasServiceModel ?model .
?model gr:quantitativeProductOrServiceProperty ?f .
?f rdf:type cloudtaxonomy:MemorySize .
?f gr:hasMinValue ?value
FILTER ( ?value >= 3.7 )
}
}
}
{ SELECT REDUCED ?offering
WHERE
{ ?offering rdf:type core:ServiceOffering .
?offering core:includes ?serv
{ ?serv gr:quantitativeProductOrServiceProperty cloudtaxonomy:DiskSize .
?f gr:hasValue ?value
FILTER ( ?value >= 150.0 )
}
UNION
{ ?serv gr:quantitativeProductOrServiceProperty ?f .
?f rdf:type cloudtaxonomy:DiskSize .
?f gr:hasValue ?value
FILTER ( ?value >= 150.0 )
}
UNION
{ ?serv core:hasServiceModel ?model .
?model gr:quantitativeProductOrServiceProperty cloudtaxonomy:DiskSize .
?f gr:hasValue ?value
FILTER ( ?value >= 150.0 )
}
UNION
{ ?serv core:hasServiceModel ?model .
?model gr:quantitativeProductOrServiceProperty ?f .
?f rdf:type cloudtaxonomy:DiskSize .
?f gr:hasValue ?value
FILTER ( ?value >= 150.0 )
}
UNION
{ ?serv core:hasServiceModel ?model .
?model gr:quantitativeProductOrServiceProperty ?f .
?f rdf:type cloudtaxonomy:DiskSize .
?f gr:hasMinValue ?value
FILTER ( ?value >= 150.0 )
}
}
}
{ SELECT REDUCED ?offering
WHERE
{ ?offering rdf:type core:ServiceOffering .
?offering core:includes ?serv
{ ?serv gr:qualitativeProductOrServiceProperty ?f .
?f rdf:type cloudtaxonomy:Feature .
?f rdfs:label ?value
FILTER REGEX(?value, "Virtual Machine", "i")
}
UNION
{ ?serv core:hasServiceModel ?model .
?model gr:qualitativeProductOrServiceProperty ?f .
?f rdf:type cloudtaxonomy:Feature .
?f rdfs:label ?value
FILTER REGEX(?value, "Virtual Machine", "i")
}
}
}
}
Jena's loading the information from the model correctly and every platform has the same data. No reasoner is being used on either of them.
JAVA source.
You can download the dataset from here.
Protégé and TopBraid find 19 results, Jena finds 0.
Jena: VERSION: 2.11.1
Jena: BUILD_DATE: 2014-01-18T19:01:20+0000
ARQ: VERSION: 2.11.1
ARQ: BUILD_DATE: 2014-01-18T19:01:20+0000
RIOT: VERSION: 2.11.1
RIOT: BUILD_DATE: 2014-01-18T19:01:20+0000
$ sparql --query query.qv --data amazonOnDemand_fullset0.ttl
------------
| offering |
============
------------
Any ideas on what might be the problem here? Running eclipse with jdk 1.8.0 64bits.
When I run this using Jena's command line tools (after downloading your data and storing your query in
query.rq
), I get a number of results. I don't know if they're what you expected, or what you're getting from Protégé, since you didn't post them, but it's not empty, so I assume it's what you're expecting.After the edit, you've provided complete code, but it still works. I've downloaded it, along with a copy of the data, and aside from a change to the path name, I get the results you'd expect.
Output: