limit - What are brackets in SPARQL and why is the linked movie database limited to 2500 records? -


the following sparql query fetches 2500 records actors , films don't know why limited 2500:

prefix dcterms: <http://purl.org/dc/terms/> prefix movie: <http://data.linkedmdb.org/resource/movie/>  select ?id ?filmtitle ?actorname {  service <http://data.linkedmdb.org/sparql> { ?film movie:film ;       movie:filmid ?id ;       dcterms:title ?filmtitle ;       movie:actor [ movie:actor ;                     movie:actor_name ?actorname ].   } } 

the query answer question: querying linked movie database (lmdb) sparql

what a keyword mean? square brackets [] stand for?

i understood a keyword substitute rdf:type , rewrote portion of sparql query without actors. still can't figure out meaning of square brackets [].

prefix movie: <http://data.linkedmdb.org/resource/movie/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select  ?film ?id ?filmtitle {  #values ?filmtitle { "the matrix" } service <http://data.linkedmdb.org/sparql> {     ?film rdf:type movie:film.     ?film movie:filmid ?id.     ?film rdfs:label ?filmtitle.    } } 

thanks responses code misses out actors movies. example movie "a bridge far" has 18 actors result of query has 2

prefix dcterms: <purl.org/dc/terms/>;  prefix movie: <data.linkedmdb.org/resource/movie/>;  select ?id ?filmtitle ?actorname  {  service <data.linkedmdb.org/sparql>;  {    ?film movie:film ;    movie:filmid ?id ;   dcterms:title ?filmtitle ;    movie:actor [ movie:actor ;             movie:actor_name ?actorname ].   }  } order asc(?filmtitle)  

my edited code, still giving same result of 2 actors instead of 18

filmlist.rq

prefix movie: <http://data.linkedmdb.org/resource/movie/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select  ?film ?id ?filmtitle ?actorname {    #values ?filmtitle { "the matrix" }   service <http://data.linkedmdb.org/sparql> {         ?film rdf:type movie:film.         ?film movie:filmid ?id.         ?film rdfs:label ?filmtitle.         ?film movie:actor ?actorid.         ?actorid movie:actor_name ?actorname.    } } order asc(?filmtitle) 

[ … ] blank node

the square brackets described in sparql 1.1 query language. in particular, see 4.1.4 syntax blank nodes

4.1.4 syntax blank nodes

blank nodes in graph patterns act variables, not references specific blank nodes in data being queried.

blank nodes indicated either label form, such "\_:abc", or abbreviated form "[]". blank node used in 1 place in query syntax can indicated []. unique blank node used form triple pattern. blank node labels written "_:abc" blank node label "abc". same blank node label cannot used in 2 different basic graph patterns in same query.

the [:p :v] construct can used in triple patterns. creates blank node label used subject of contained predicate-object pairs. created blank node can used in further triple patterns in subject , object positions.

the following 2 forms

[ :p "v" ] . [] :p "v" . 

allocate unique blank node label (here "b57") , equivalent writing:

_:b57 :p "v" . 

this allocated blank node label can used subject or object of further triple patterns. example, subject:

[ :p "v" ] :q "w" . 

which equivalent 2 triples:

_:b57 :p "v" . _:b57 :q "w" . 

and object:

:x :q [ :p "v" ] . 

which equivalent 2 triples:

:x  :q _:b57 . _:b57 :p "v" . 

a shorthand rdf:type

what keyword mean? square brackets [] stand for?

i understood keyword substitute rdf:type

there's not more that. can use a instead of rdf:type:

4.2.4 rdf:type

the keyword "a" can used predicate in triple pattern , alternative iri http://www.w3.org/1999/02/22-rdf-syntax-ns#type. keyword case-sensitive.

?x   :class1 . [ :appclass ] :p "v" . 

is syntactic sugar for:

?x    rdf:type  :class1 . _:b0  rdf:type  :appclass . _:b0  :p        "v" . 

linkedmdb imposes odd limits

the linkedmdb endpoint imposes odd limits on query results. other questions , answers have touched on in past, including:

if need specific results outside of default range of what's returned, you'll want include order by , limit. so, endpoint has odd behavior, , specific problems, you're best off contacting them directly; of these oddities don't indicate problem query, problem endpoint.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -