OR statement in SPARQL [ask for suggestions]

381 views
Skip to first unread message

Dhira P. Yuga

unread,
Apr 25, 2012, 12:50:39 AM4/25/12
to arc...@googlegroups.com
I want to select ?hasTitle and ?hasKeyword where ?hasTitle OR ?hasKeyword have value "communication".
How should I write this condition on SPARQL?
the result must show data that contain the value in ?hasTitle OR in ?hasKeyword. 

I've try OPTIONAL {filter regex(?hasTitle, "communication", i)} . filter regex(?hasKeyword, "communication", "i").
the result: i get all ?hasKeyword with that value, and doesn't get all ??hasTitle with that value

I've also try OPTIONAL {filter regex(?hasKeyword, "communication", i)} . filter regex(?hasTitle, "communication", "i").
the result: i get all ?hasTitle with that value, and doesn't get all ??hasKeyword with that value

if I use UNION for both of them, it has no result found.
Please help me for that.

--
Thank You,


Dhira P. Yuga

Dhira P. Yuga

unread,
Apr 26, 2012, 1:18:25 AM4/26/12
to arc...@googlegroups.com
--
Regards,


Dhira P. Yuga

Dhira P. Yuga

unread,
Apr 26, 2012, 1:20:06 AM4/26/12
to k.j.w.a...@gmail.com, arc...@googlegroups.com

Stéphane Corlosquet

unread,
Apr 26, 2012, 3:40:41 PM4/26/12
to arc...@googlegroups.com
Hi Dhira,

People on this mailing list are all volunteers. If someone knows the answer to your question chances are they'll reply you (give it a few days). No need to resend your email multiple times or contact people directly.

In your case I'd advice to try the query you're attempting on a different SPARQL Endpoint library, to see if it's a bug with ARC2 directly or just that your SPARQL query is not correct. You have two options:

1) install another RDF store with SPARQL endpoint on your machine, load your data and try to run SPARQL queries against it.

2) find a public SPARQL Endpoint and try to replicate your query on that endpoint using the data of the endpoint. some also allow you to load your data from a remote location.

Steph.

Dhira P. Yuga

unread,
Apr 26, 2012, 7:59:04 PM4/26/12
to arc...@googlegroups.com
Okey, Thank You, I'll check them.
Sorry about that, 'cause I'm new here.

Dhira.
Reply all
Reply to author
Forward
0 new messages