Date: 2010-06-21 16:03:31
From: adamcoen86-at-googlemail.com
Hi, I'd like to count the number of tracks included for each soundtrack
album in freebase.
Using FactForge sparql end-point first I select movies from DBpedia, then I
use the freebase URI to get to the soundtrack page:
PREFIX fb-film: <http://rdf.freebase.com/ns/film.film.>
PREFIX db-ont: <http://dbpedia.org/ontology/>
PREFIX db-work: <http://dbpedia.org/ontology/Work/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT  ?id ?uriOST
WHERE {
?id rdf:type db-ont:Film .
?id owl:sameAs ?uriFB .
?id db-ont:releaseDate ?data_uscita .
?id db-work:runtime ?durata .
?id db-ont:gross ?incasso .
?uriFB fb-film:soundtrack ?uriOST .
FILTER regex(str(?uriFB),"freebase")
}
LIMIT 300
Now I'd like to count the number of tracks which the soundtrack is composed
by, but I really don't know how since FactForge doesn't accept neither COUNT
nor GROUP BY.
Could anybody help me?

asked 03 Apr '13, 04:21

Discussion-Board-Archive's gravatar image

Discussion-B...
6.1k136156214
accept rate: 30%

edited 17 Apr '13, 10:51

nkrustev's gravatar image

nkrustev ♦♦
66117


Date: 2010-06-21 17:25:13
From: ivan.peikov-at-ontotext.com
Hi Adam,
Unfortunately, SPARQL doesn't support grouping (as supported in SQL). In this 
case you will probably have to implement this functionality in the result 
processing code (i.e. do the counting yourself).
BTW, this is a very common complaint from SPARQL and is not a deficiency of 
FactForge but a limitation of the SPARQL standard.
BigOWLIM (the storage and inference engine behind FactForge) supports result 
counting in its own custom-tailored way, but even this mechanism won't help 
in your case -- it can count the number of all results returned by the query, 
but it can't group results by soundtrack and count the results in each group.
Cheers,
Ivan
link

answered 03 Apr '13, 04:21

Discussion-Board-Archive's gravatar image

Discussion-B...
6.1k136156214
accept rate: 30%

edited 17 Apr '13, 10:51

nkrustev's gravatar image

nkrustev ♦♦
66117

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×261
×242
×38

Asked: 03 Apr '13, 04:21

Seen: 836 times

Last updated: 26 Oct '16, 07:22

powered by BitNami OSQA