Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FILTER subject in an array of values #139

Closed
craigdietrich opened this issue Mar 14, 2020 · 1 comment
Closed

FILTER subject in an array of values #139

craigdietrich opened this issue Mar 14, 2020 · 1 comment

Comments

@craigdietrich
Copy link
Contributor

Hi all,

I can't seem to get a FILTER to work that checks if ?s is present in an array. Note that this is SPARQL 1.1 and I recall that ARC2 doesn't completely implement 1.1.

PREFIX dcterms:  <http://purl.org/dc/terms/> .
SELECT *
WHERE {
  ?s dcterms:type ?o . 
  FILTER (?s IN ("urn:scalar:version:27560","urn:scalar:version:27559"))
}

Errors:
Array

(
    [0] => Incomplete FILTER in ARC2_SPARQLPlusParser
    [1] => Incomplete or invalid Group Graph pattern. Could not handle "                 FILTER (?s IN" in ARC2_SPARQLPlusParser
)

Curious if there's another way to do this or if my syntax is wrong? (Note that I could use a UNION but then I wouldn't be able to return ?s in the results, I don't think.) Thanks!

@craigdietrich
Copy link
Contributor Author

Ah, figured it out! SPARQL 1.0 solution:

PREFIX dcterms:  <http://purl.org/dc/terms/> .
SELECT *
WHERE {
  { ?s dcterms:source ?o . }
  FILTER (?s = "urn:scalar:version:27560" || ?s = "urn:scalar:version:27559")
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants