|
#1
|
|||
|
|||
|
Problems with the Query Language
Hi all,
I need to search for all blog's posts wrote from the same author. To do it I have to use SIOC ontology. So, when I wrote this query on Advanced search form: * <http://rdfs.org/sioc/ns#User> * I "found about 9.62 thousand" among which an author called Fred. But if I search for: * <http://rdfs.org/sioc/ns#User> "Fred" the result is Search results for advanced “* <http://rdfs.org/sioc/ns#User> "Fred"”, found 0 . Thank you in advance. |
|
#2
|
|||
|
|||
|
Hi Taytor! The problem is that sioc:User is a class, not a property. What you are looking for is the user's name:
* <http://rdfs.org/sioc/ns#name> "Fred" Your first query, * sioc:User *, actually shouldn't return any results AFAICT, this might be a bug on our side. I will look into this. |
|
#3
|
|||
|
|||
|
Hi Taytor,
yes, this is a known bug in the beta1 version. When a triple pattern contains two wildcards, the position is not taken into account. So, the queries Code:
* <http://rdfs.org/sioc/ns#name> * Code:
* * <http://rdfs.org/sioc/ns#name> The problem will be solved in beta2, which will be deployed in January. For the moment, we recommend to avoid the use of two wildcards in a single triple pattern. Hope this help. |
|
#4
|
|||
|
|||
|
Quote:
In my case I have to search for all blog's post (ant posts could be from forums or from blogs) and they have to be wrote from a User named "user". |
|
#5
|
|||
|
|||
|
To search all blog posts that mention triples about SIOC Users and about a resource with a certain sioc#name, you could use:
Code:
* <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://rdfs.org/sioc/ns#User> AND * <http://rdfs.org/sioc/ns#name> "Fred" Code:
* <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://rdfs.org/sioc/ns#User> Code:
* <http://rdfs.org/sioc/ns#name> "Fred" Code:
<http://example.org/user1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://rdfs.org/sioc/ns#User> . <http://example.org/user2> <http://rdfs.org/sioc/ns#name> "Fred" . |
|
#6
|
|||
|
|||
|
Thank you, now it works
Regards, Sarah |
|
#7
|
|||
|
|||
|
Another approach is to make this a two-step process.
First, find out the URI (unique identifier) of authors called Fred. For this, you run the query I've given above, * sioc:name "Fred". Then, fetch the resulting RDF documents, load them all into a local RDF model, and find the URI of each author, e.g. by running this SPARQL query: Code:
SELECT ?author WHERE {
?author sioc:name "Fred" .
}
Code:
* <http://rdfs.org/sioc/ns#has_creator> <xxx> Example query result for one author named Fred |
|
#8
|
|||
|
|||
|
Okay, but the last solution founds the posts of the author from an only blog, doesn't it?
Now I have noted that the query Code:
* <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://rdfs.org/sioc/ns#User> AND * <http://rdfs.org/sioc/ns#name> "Fred" |
|
#9
|
|||
|
|||
|
Quote:
Quote:
|
|
#10
|
|||
|
|||
|
To search all blog posts that mention triples about SIOC Users and about a resource with a certain sioc#name, you could use:
Code:
* <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://rdfs.org/sioc/ns#User> AND * <http://rdfs.org/sioc/ns#name> "Fred" Code:
* <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://rdfs.org/sioc/ns#User> Code:
* <http://rdfs.org/sioc/ns#name> "Fred" Code:
<http://example.org/user1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://rdfs.org/sioc/ns#User> . <http://example.org/user2> <http://rdfs.org/sioc/ns#name> "Fred" . |
| Tags |
| query language, sioc |
| Thread Tools | |
| Display Modes | |
|
|