semantic-web

Semantic mediawiki #ask query: Displaying nested properties on the same query

孤街醉人 提交于 2019-12-05 18:42:40
I would like to display in the same query properties of a page which is related to the pages im querying for. Let's say I would like to query all the pages in the City category, which are located in Germany, and I want to display the title of the page, but also I want to display the surface data of Germany, for example. Something like this: {{#ask: [[Category:City]] [[location::Germany]] |?mainlabel |?Location.surface }} I know this wont work, but you can see what I want to achieve. I'm not sure if there's a way to nest queries directly inside other queries. The normal method of doing it is

how to query Dbpedia in Javascript

风流意气都作罢 提交于 2019-12-05 18:38:15
I want to get the Abtract of english article of civil engineering from Dbdepdia in Javascript. this is what I tried but it fail. <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <style type="text/css"> </style> </head> <script type="text/javascript"> var url = "http://dbpedia.org/sparql"; var query = "\ PREFIX dbpedia2: <http://dbpedia.org/resource/>\ PREFIX Abs: <http://dbpedia.org/ontology/>\ SELECT ?abstract\ WHERE {\ ?s dbpedia2:Civil_engineeringe\"@en;\ Abs:abstract ?abstract\ }"; this how I encode the url to pass it to ajaxx var

How to extract RDF triples from XML file using an existing ontology?

半腔热情 提交于 2019-12-05 10:58:47
I am trying to extract RDF triples from XML files by using an existing ontology. I am using Java, and can use XPath to extract data from XML and Jena to read and write RDF documents and ontologies. How can I extract the relevant triples from the XML according to the existing ontology? Forget about XPath to extract triples, it way easier and less problematic with Jena. You can use the interface SimpleSelector together with model.listStatements from Jena. In this example I am using SimpleSelector to find all the triples with a single property but you can implement the any search you need by

Extract relevant sentences to entity

纵饮孤独 提交于 2019-12-05 07:54:08
问题 Do you know some paper or algorithm in NLP that is able to extract sentences from text that are related to given entity (term). I would like to process some reviews (mainly tech), but I found out that many reviews mention more then one product (they do comparation). I would like to extract from that text just sentences that are relevant to one product, or delete sentences that are irrelevant to particular named entity (product). My questin is how to do it? Is there some related papers? Is

Reading a Turtle/N3 RDF File with Python

我的未来我决定 提交于 2019-12-05 03:32:09
I'm trying to encode some botanical data in Turtle format, and read this data from Python using RDFLib . However, I'm having trouble, and I'm not sure if it's because my Turtle is malformed or I'm misusing RDFLib. My test data is: @PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @PREFIX p: <http://www.myplantdomain.com/plant/description> . p:description a rdfs:Property . p:name a rdfs:Property . p:language a rdfs:Property . p:value a rdfs:Property . p:gender a rdfs:Property . p:inforescence a rdfs:Property . p:color a rdfs

Retrieving all paths in an OWL class hierarchy with SPARQL and Jena

余生长醉 提交于 2019-12-04 17:58:48
I have an RDF graph of with a hierarchy three levels deep. I want to retrieve all the paths starting from the root of the class hierarchy (i.e., owl:Thing ) down to classes in the third level without using a reasoner. For instance, I would like the path C 1 &rightarrow; C 2 &rightarrow; C 3 is a path, where each C i is a class at the i th level of the hierarchy. I need to retrieve all the paths in the RDF graph using the breadth first search algorithm with no considerations to the object properties in the graph. Given some data like this (where length of the class name is an indication of the

Is there an API to get results similar to Google's “people also search for”?

大憨熊 提交于 2019-12-04 17:12:30
I'm looking for an API that would give similar results to the Google's "people also search for" feature. So that, for instance, when I search for Stanley Kubrik, I see all the other film directors that people search for. I know about the Freebase API but it simply provides information about the search item, not what other search items it may be related to. There is also a TargetingIdeaSelector tool in Google AdWords API that shows related keywords, but that doesn't really range the results semantically. Finally, there's a very simple Bing API that shows related searches (also here ), but,

boundary for arbitrary property path in SPARQL 1.1

僤鯓⒐⒋嵵緔 提交于 2019-12-04 16:59:53
Is it possible to bound the length of property path? For example getting all the triples with lengths that are between (m,n) or all that are not between this range? For instance, how could this be done with the following query? select ?x ?y where {?x p* ?y} Joshua Taylor Some endpoints support this directly Some SPARQL engines support a method for doing this directly, with a regular-expression-like syntax. E.g., ?s :p{n,m} ?o would be a path with a length between n and m. That syntax is described in SPARQL 1.1 Property Paths: W3C Working Draft 26 January 2010 . There is also support for exact

converting freebase MQL to SPARQL

吃可爱长大的小学妹 提交于 2019-12-04 09:05:49
following freebase MQL finds 5 artists and 50 albums for each artists. [{ "type" : "/music/artist", "name":null, "album" : [{ "name" : null, "count":null, "limit":50 }], "limit":5 }] first try - without a subquery I can write SPARQL like this: SELECT ?artist ?album WHERE { ?artist :type :/music/artist . ?artist :album ?album } LIMIT n but, I don't know how many n should be specified because SPARQL has no hierarchy as far as I know. second try - with a sub-query (not sure this works correctly) Following sub-query looks like working. SELECT ?artist ?album WHERE { ?artist :album ?album . { SELECT

How to create a basic semantic search in python

女生的网名这么多〃 提交于 2019-12-04 07:23:20
I want to write a basic semantic web crawler using Python, I know that semantic apps use RDF files, but what else? I have some Python RDF modules installed and I started learning how they work. Could you introduce me to the technologies and techniques used in a semantic application? Lev Khomich The next things you might want to learn are: embedding samantic data in HTML - RDFa , microformats , microdata . Some stats: microformats and RDFa deployment across the Web via DAM.co.uk : querying RDF data - SPARQL most popular ontologies currently in use list of available SPARQL endpoints You can find