i’m building an integration system that makes a query to the prefixSearch Api of dbPedia
http://lookup.dbpedia.org/api/search.asmx/PrefixSearch?QueryClass=&MaxHits=1&QueryString=KEYWORD
From this i obtain an URI of a resource and get the resource using a simple get and i parse it using nokogiri
data = Net::HTTP.get(URI.parse(url.to_s+'.rdf'))
doc = Nokogiri::XML(data)
from the doc i need to find the abstract , so using xpath i find it successfully .
entity = doc.root.xpath("/rdf:RDF/rdf:Description[@rdf:about=\""+@uri+"\"]").map do |node|
name = node.xpath("dbpedia-owl:abstract[@xml:lang=\"en\"]").first.content
end
The problem is that for some pages that are information rich, like the pages referring to nations, doing this operation will takes 15-16 seconds. this is not acceptable in my system.
So i need to find a way to do all the things faster?
Is there any solution? For instance using SPARQL
Thanks to all
If you only need specific information about the URI then likely you can write a SPARQL query for just that information which should make things much faster.
You need to elaborate on exactly what information you need but I assume you are looking for the english abstract about the URI based on the code you showed: