How to write SPARQL Query to retrieve data about Tourism from DBpedia??
Can any one elaborate it( how to write SPARQL Query & what are the things i should already know to start with SPARQL), as i am completely new to this.
An example SPARQL query for a starter can be (if you are impatient, jump to the result set):
SELECT ?uri ?txt WHERE {
?uri rdfs:label ?txt .
?txt bif:contains "Tourism" .
}
For a very good and gentle introduction to Semantic Web (with lots of very nice SPARQL examples) please see
Semantic Web for the Working Ontologist, Second Edition: Effective Modeling in RDFS and OWL
And in order to learn how to integrate Semantic Web technologies into your custom software applications, this is a very good resource (with lots of example using Semantic Web APIs / toolkits such as Jena):
A Developer’s Guide to the Semantic Web
You can take a look at the W3C spec W3C spec, but you also have plenty of tutorials to look online if you search for them e.g. http://www.cambridgesemantics.com/2008/09/sparql-by-example/. You also have some resources on the DBpedia site. Also plenty of end user tools, check out Visor and VisualDataWeb.org.
Related
I am trying to practice myself in writing some SPARQL queries. Does anybody know where I can find the best material? Where I can find some RDF file and some tasks to try to write my own SPARQL queries. I am good with SQL, and I just need some material to learn to write in SPARQL.
All sample RDF and queries from the O'Reilly book "Learning SPARQL" are available on the book's home page at learningsparql.com. (Full disclosure: I wrote it.)
data.gov and DataHub have a lot of downloadable RDF data sets. If a public SPARQL endpoint is available, DataHub usually lists it. For example: the Rijksmuseum page offers RDF downloads and a link to the endpoint.
My Experiment has a tutorial with examples and a working endpoint.
If you download Jena, you get their example RDF files and SPARQL queries.
Uniprot has a SPARQL endpoint with examples. The RDF is available for download. some of the files are quite large.
There's a large number of downloadable ontologies in RDF format at the OBO Foundry.
Watch this: Probe the Semantic Web with SPARQL
SPARQL Cheat Sheet Slide Deck
As mentioned above: the website for Bob DuCharme's excellent Learning SPARQL Book
I need your help with the following situation.
I have a local relational database that contains information about several places in a city. These places could be any kind of attraction: Museum, a cathedral, or even a square.
As an example I have information about "Square Victoria" (https://en.wikipedia.org/wiki/Victoria_Square,_Montreal)
A simple search in google gave me the wikipedia URL above. But I want to be able to do it programmatically.
For each place in the database I have also its category (square, museum, church, ....). These categories are local only and do not match any standardized categorization.
My goal is to improve this database by associating each place to its dbpedia URI.
My question is what is the best way to do that? I have some theoretical background about Semantic Web technologies but I don't have yet the practice skills to determine how to do that.
More specific questions:
Is it possible to determine the dbpedia URI using sparql only?
If it is not possible to do it with sparql only, what other technologies would I need to be able to accomplish that?
Thank you
First of all I would recommend, if you have not done it yet, to have a look at wikidata. This project is a semantic extension to wikipedia, but contrary to dbpedia, the data is not extracted from wikipedia, it is created by contributors, and therefore appears (or will appear as the project is still growing) to be more relevant.
The service offers many solutions to access data (including a Sparql endpoint), and it's main advantage is that the underlying software is mediawiki, same used for wikipedia and other Wikimedia foundation projects. The mediawiki API offers an Opensearch option that should allow you to search more efficiently that Sparql queries.
Putting everything together, I think it might be worth having a look at wikidata + wikipedia API to get pivot data to align you local database.
No direct answer but I hope that will help.
How can Jena be used to save triples in a SPARQL endpoint?
I could use SPARQL RestFul API but I wonder if this is also doable using Jena classes.
For SPARQL Update you can do the following:
UpdateRequest update = UpdateFactory.create("# Your SPARQL Updates");
UpdateProcessor processor = UpdateExecutionFactory.createRemote(update, "http://your-domain/update");
processor.execute();
If you are talking about the graph store protocol i.e. uploading entire graphs at once then you can use the DatasetAccessor API e.g.
DatasetAccessor accessor = DatasetAccessorFactory.createHTTP("http://your-domain/ds");
accessor.putModel(m);
If you are talking about MarkLogic specifically (you tagged the question with marklogic), then this github project will likely interest you:
https://github.com/marklogic/marklogic-jena
This library integrates MarkLogic Semantics feature into the Jena RDF
Framework as a persistence and query layer.
Note: not officially released yet currently, but close. Might be worth a look..
HTH!
can anyone tell me what commonalities and diffrences are between an ontology on the semantic web and a database on the syntactic web?
By going to answers.semanticweb.com you could likely get a thoughtful and descriptive comparison of the two. Since I'm short on time I'll just give you the resources where you can dig in further. See Wikipedia for Syntactic Web and for Semantic Web. See also:
Executive’s Quick Start Guide to Web 3.0 and the Semantic Web
Linked Data: The Story so Far
RDF Primer
RDFa Primer
Although i have a little bit of experience in developing dynamic websites using ASP technologies, but I am new to semantic web programming, and i intend to implement a website based on semantic web technology.I would like to develop a search engine, where a web user can query for keywords from the backend RDF triple store.I want to implement the website using Java and JSP.I have following questions:
I am currently studying Jena framework and SPARQL to start with,but
i am not sure what other technologies i need to study in order to
implement the website.
What is the difference between RDF and OWL, I have gone through a
lot of web resources but i am still confused.As per my understanding
RDF and OWL both define relationship between concepts but OWL is
more rich in terms of defining relations.
What is meant by different OWL Vocabularies like FOAF, SIOC etc.Why
do we need these vocabularies?
What exactly is the purpose of Virtuso Open Link
Software(http://ods.openlinksw.com/dataspace/dav/wiki/Main/VirtJenaProvider)
Any help would be highly appreciated.
Thanks!
I would definitely like to be kept up to date of your progress. I'm not experienced with java or jsp. I wonder if this could be done in php? I know that some work has been done in python on this kind of thing.
There are some extensions to drupal that work with these semantic web technologies and Semantic Media Wiki is good too.
Check out this and the related links at the bottom. The difference between microformats and vocabularies can be difficult to understand but I think there is a difference, say between a vocabulary like FOAF and a microformat like hCard, hCalendar or hResume. Oh, the link:
http://en.wikipedia.org/wiki/FOAF_(software)
Anyway these related terms are included.
Thanks,
Bruce
http://futurewavedesigns.com
Re: your first question - why do you want to use RDF to implement a keyword search? Keyword search isn't semantic, and there are many established frameworks and APIs for keyword search, such as Lucene.
Re: your second question, comparing RDF and OWL is comparing apples and oranges. RDF is basically for declaring data, but OWL is a layer on top of RDF that is for declaring ontologies (schemas). A more meaningful comparison would be between RDFS (RDF Schema) and OWL, which both address the ontology layer.
Example:
In RDF you might state that John Smith is a Person who hasAge "42" and is marriedTo Jill Smith.
In RDFS or OWL you would declare that Person is a class, hasAge is a property (with domain of Person and range of xsd:integer) and marriedTo is a property (with domain and range of Person).
In OWL you can also declare that marriedTo is a symmetric property (if A is marriedTo B, then B must be marriedTo A). RDF isn't this powerful, so you can't make this particular statement, so can't make inferences about symmetric properties etc.