All data in a SPARQL query

Hello, I’m trying to make a query as the next one:

SELECT DISTINCT * where{ GRAPH <http://opendata.eurohelp.es/dataset/recursos-humanos> {
  #Se seleccionan datos de personas con distintas categorias
  ?persona rdf:type <http://schema.org/Person>. 
  ?persona rdf:type ?Categoria.
  ?Categoria <http://schema.org/name> ?nombreCategoria.
  ?Categoria rdf:type <http://opendata.euskadi.eus/puesto>.
  #Se seleccionan datos de personas con diferentes experiencias
  ?persona <http://opendata.euskadi.eus/experience> ?Experiencia.
  ?Experiencia <http://schema.org/name> ?nombreExperiencia.
  #Se seleccionan datos de personas con diferentes habilidades
  ?persona <http://opendata.euskadi.eus/skill> ?lenguajeProg.
  ?lenguajeProg <http://schema.org/name> ?nombreLenguajeProg.
  #Se seleccionan datos de personas con diferentes certificaciones
  ?persona <http://opendata.euskadi.eus/certification> ?certificacion.
  ?certificacion <http://schema.org/name> ?nombreCertificacion.
  #Se seleccionan datos de personas con diferentes idiomas
  ?persona <http://opendata.euskadi.eus/idioma> ?idioma.
  ?idioma <http://schema.org/name> ?nombreIdioma.

  FILTER (?nombreCategoria IN ("Jefe de proyecto","Programador Senior"))
  FILTER (?nombreExperiencia IN ("Eurohelp Consulting"))
  FILTER (?nombreLenguajeProg IN ("HTML", "JAVA", "C++"))
  FILTER (?nombreCertificacion IN ("ISTQB"))
  FILTER (?nombreIdioma IN ("Spanish"))
}}

and get the results in a JSON format. My problem is that for getting the data, I’m using some “filters” like ?persona rdf:type http://schema.org/Person.. So, my json only have:

“persona” : {
“type” : “uri”,
“value” : “http://opendata.eurohelp.es/LeireBardaji
}

It’s omitted the predicate: rdf:type and the object: http://schema.org/Person. Do you know any way to get all the data that I want? Thank you for your attention.

Regards

Hi,

The application/sparql-results+json format is just going to show you the bindings that result from your query. You’re doing a SELECT DISTINCT *, so each binding will contain ?persona, ?Categoria, ?nombreCategoria, etc. Each of those variables is bound just to one value, in the case of “persona” in your example, it’s bound to the URI http://opendata.eurohelp.es/LeireBardaji. Because you have ?persona rdf:type ?Categoria in your query, in that same binding object there should be something to the effect of:

"Categoria" : {
  "type" : "uri",
  "value" : "http://schema.org/Person"
}

So you’ll want to look at the entire “bindings” object, and that should contain all the info you selected

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.