sparql

Object-to-Triple mapping using AllegroGraph RDF store?

My project is building a Java web application on top of the AllegroGraph RDF store. I would like to find a good solution to map between the triples that come out of the store and our domain objects. I have looked into Topaz, an Object/Triple mapping API being developed in the spirit of Hibernate. The trouble is that they don't current...

SPARQL query - Class and subclass give a class name and namespace

How can i get all the class properties and its sub classes with properties from an RDF datasource using SPARQL query given a class name and namespace? ...

SPARQL Query, select everything except things that match?

I am getting comfortable writing regular queries in SPARQL, but I'm still having trouble with fancier stuff. My latest problem is trying to select everything except stuff that matches the where clause. For instance, say I want to find all the husbands who like a car color that their wife doesn't like (I'm working on a proprietary model...

Property-values database

I have a number of objects, each one have an arbitrary number of shared, and distinct property-value pairs (more specifically: files, and their related properties -such as width, and height values for images, album/artist/length for music files, etc). I'd like to be able to search for objects having specific property/values (such as: by ...

SPARQL select RDF:ID

I am trying to select the rdf:ID of an object with sparql (inside Protege) and I cant seem to get the rdf:ID. Has anyone seen this problem. The SPARQL query i am using is: Select * where (?element rdf:id ?id) The following also does not work: Select * where (?element rdfs:label ?id) Took a suggestion, but still this is no go: Select...

What is the semantic web?

I've heard a lot about the semantic web but I'm still not exactly sure what it is. How will it be different to the web we know now? ...

SPARQL query in Protege

I am trying to query my ontology through the Protégé Tool. But the result I am getting for my queries is "No Match Found". My SPARQL query is given below. SELECT ?g WHERE { ?g rdfs:subClassOf "#bomb" . } Please can anyone tel me why am I getting the result as this. Thanks in advance. ...

Semantic Search help needed urgently..

Hi, Im trying to create a semantic search using java as a base programming language. My task is to create a search prototype which contains triples namely patients, visits and doctors. If i search with a patient name the result should be the patients name and the the time of visit and the corresponding doctors name. Im going to use trip...

SPARQL Query problem -> wrong answer

I want to select a triple using SPARQL. To do it, i'm using following query: SELECT count (*) WHERE {?s ?p ?o} FILTER (?s=http://kjkhlsa.net && ?p=http://lkasdjlkjas.com && ?o=Test) As answer i get fully wrong triple :( subject ist not equal to "http://kjkhlsa.net", predicate is not equal to "http://lkasdjlkjas.com" and object ist als...

Problem with a select SPARQL query on dbpedia

Hello, I try to get some data about a city using Sparql query on DBpedia. The problem is I can't get the query to work. Currently I do something like this: SELECT ?title,?name,?abs WHERE { ?title skos:subject <http://dbpedia.org/resource/Category:Cities%2C_towns_and_villages_in_Slovenia&gt;. ?title dbpprop:officialName ?name....

Browser fails to recognise Content Type header correctly

I have an issue with my browser failing to recognise the content types I am sending in my responses and trying to download the file instead of displaying it. I have a generic handler (named SPARQL.ashx) written in ASP.Net which does some work and produces an object which is of two possible types. Either it gets a SPARQLResultSet or a...

How to include variable in SPARQL query using PHP

I am creating a query form and let the user to enter the keyword from the form. Then the query form will bring to the next page where I carry the variable created in the query form to the next page. The excerpt code for the new page is as folows: //received variable $abc1=$_POST['querykeyword']; $querystring = ' Prefix try <http://www....

How to display sparql query result in the formatted html table

How can I display the result of my sparql query into html table?. Any idea? ...

Sorting SPARQL results by date

Is there a way to sort the results by creation date? Example query which must be sortet: SELECT * WHERE {?s ?p ?o} limit 200 ...

Is there a way to read a Hibernate Session as RDF triples?

I need to query my local Hibernate managed datastore for persisted objects based on criteria where the relevant data for the WHERE clause is in the Linked Open Data cloud. Is there a way to read a Hibernate Session as RDF? If so, I can at least use the combined Dataset to decide what objects to retrieve from Hibernate. Preferably the s...

SPARQL Query and distinct count

hi all, i have the following query: SELECT ?tag WHERE { ?r ns9:taggedWithTag ?tagresource. ?tagresource ns9:name ?tag } LIMIT 5000 and the results are: abc abc abc abc abc abc abc abd ads anb I want to get somthing like tag | count ----------------- abc 7 abd 1 ads 1 anb 1 I have tried it with count(*) and count...

Filtering SPARQL Results

I have following example triples r1 -> property -> resourceA r1 -> property -> resourceB r1 -> property -> resourceC resourceA -> name -> word1 resourceB -> name -> word2 resourceC -> name -> word4 r2 -> property -> resourceD r2 -> property -> resourceE r2 -> property -> resourceF resourceD -> name -> word1 resourceE -> name -> word2 r...

Power in sparql and other math functions

Hi I am trying to write a sparql query where I want to filter on the square of something, but I am simply unable to figure out how to square a number (x^2) (except by multiplying it with itself of cause.) I guessed a square root function called math:sqrt() which works, yet nothing like math:pow seems to exist. How do I get the square o...

A SPARQL Beginner Question

Hi guys, I am just starting SPARQL recently and have got some questions. When i am querying an endpoint (linked movie database) for actor and director of a given movie title, I will get nothing back if the querying movie has only got one of the requested property ( the movie only has actor or director property, for example this "Batman...

Retrieving all the ancestors of a rdf:Class

Hi all, Imagine the following Taxonomy (acyclic & directed graph): <my:Eukaryota> <rdfs:subClassOf> <my:Organism>. <my:Mammal> <rdfs:subClassOf> <my:Eukaryota>. <my:Primate> <rdfs:subClassOf> <my:Mammal>. <my:HomoSapiens> <rdfs:subClassOf> <my:Primate>. <my:Bacteria> <rdfs:subClassOf> <my:Organism>. <my:Escherichia> <rdfs:subClassOf> <m...