How to create a topic map using rdf format?

Forum is for miscellaneous user help requests.

How to create a topic map using rdf format?

Postby Astrahan » Mon Oct 15, 2012 1:34 pm

Hello there,

I try to create a topic map using RDF as i download it from Virtuoso SPARQL Query Editor of dbpedia (in RDF/XML format). I tried to extract or import the sparql file but keeps throwing JavaExceptions and shows the message "No valid metadata". So,I created a query (which works in Vistuoso) in dbpedia through Wandora from File -> Extract -> Other-> SPARQL Extractor but it throws error (doesn't recognise dbpedia-owl:genre). However it worked once but it couldn't show ! Now it doesn't work for some reason. My query is this

SELECT DISTINCT ?band ?member
WHERE
{
?s dbpedia-owl:genre <http://dbpedia.org/resource/Hard_Rock>;
dbpedia-owl:artist ?band.
?band dbpedia-owl:bandMember ?member.
}

Please help me with this problem.

Best regards, George.
Astrahan
 
Posts: 1
Joined: Mon Oct 15, 2012 12:41 pm

Re: How to create a topic map using rdf format?

Postby akivela » Tue Oct 16, 2012 11:40 am

Hi George

Wandora's SPARQL extractor requires that you define all namespaces used in your query. Missing namespace definition results an exception in Wandora. Thus, you need to add definition

Code: Select all
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>


in front of your query. After the addition, your query looks like

Code: Select all
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
SELECT DISTINCT ?band ?member
WHERE
{
?s dbpedia-owl:genre <http://dbpedia.org/resource/Hard_Rock>;
dbpedia-owl:artist ?band.
?band dbpedia-owl:bandMember ?member.
}


You'll find all predefined namespaces of DBpedia in http://dbpedia.org/sparql?nsdecl. Now you should be able execute the query without exceptions. However, DBpedia's public SPARQL endpoint (http://dbpedia.org/sparql) gives empty result set for the query. Thus, performing SPARQL extraction in Wandora doesn't add topics nor associations in your topic map. Perhaps DBPedia doesn't know much about hard rock :)

Speaking more generally about Wandora's RDF import and SPARQL extract features. If you have a valid RDF/XML file, you can import it to Wandora using option File -> Import -> Simple RDF XML Import... This generic RDF import feature doesn't really respect any RDF vocabularies used in the RDF file. The conversion from RDF to Topic Maps in very simple and described in http://www.wandora.org/wiki/Importing_RDF. Usually you need to clean up the topic map a little after a generic RDF import. Addition to this simple RDF importer Wandora has several RDF extractors for specific RDF vocabularies, for example OWL, SKOSS and Dublin Core. These extractors try to respect the specific RDF vocabulary while transforming an RDF file to topic maps. These extractors locate in menu File -> Extract -> Simple RDF formats.

And then there is the SPARQL extractor that connects directly to a SPARQL end-point and transforms the result set to topic maps. At the moment SPARQL extractor can not be used to transform ready-made SPARQL result set files nor feeds. It really requires a SPARQL end-point. As the SPARQL result set is essentially an information table, the transformation converts each result set row to an association in topic map. Remember, associations are hyper edges i.e. they may contain more than two nodes. In my personal opinion, the conversion is very clear but may require some manual actions, depending on your vision of sought information model, of course.

Kind Regards,
Aki / Wandora Team
akivela
Site Admin
 
Posts: 256
Joined: Tue Sep 18, 2007 10:20 am
Location: Helsinki, Finland


Return to How to... and problems

Who is online

Users browsing this forum: No registered users and 1 guest