UNION and intersection using SPARQL queries
问题 I am converting user-defined-queries into SPARQL. For example, when user says, "abc", it means give me all nodes of a given type which have some attribute named "abc". As an extension of this, if user says, "abc or (pqr and lmn)", I need to find all nodes of a given type for which some attribute is "abc or (pqr and lmn)". Following is the query I have come up with: SELECT DISTINCT ?node, ?type WHERE { { ?node a ?type . FILTER ( ?type != <sometype>) } { { ?node ?reln0 ?obj0 . FILTER ( regex