I have this query:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX c: <http://s.opencalais.com/1/pred/>
SELECT ?company ?name ?ticker ?symbol WHERE {
?company rdf:type <http://s.opencalais.com/1/type/er/Company> .
?company c:name ?name .
?company c:ticker ?ticker .
?company c:symbol ?symbol
}
It only returns /Company types that contain a c:name, c:ticker, and
c:symbol. I'd like only c:name to be required, with either "" or null
being returned for a c:ticker or c:symbol is not present. To be clear,
in the actual RDF, the entire <c:ticker></c:ticker> or
<c:symbol></c:symbol> elements can be missing OR they can just be
empty.
Is this possible to express only in the query? Or do I have to perform
some sort of pre/post processing on the RDF itself? I'm iterating
through the ResultSet, calling QuerySolution.getLiteral("ticker"),
etc.
Rob