How to use rdf mappings and sparql endpoint

Events happening in the community are now at Drupal community events on www.drupal.org.
chocolatehuanghai's picture

HI!I am new to drupal,i have installed rdfx and sparl related modules,but i don't know how to use it,i see someone use it to publish linked data,and they also gave the principle of using them,but i still don't know how can the drupal map the resources into rdf form and how it can link the external data?Can you guys help me?Thank you!!

Comments

Happy to help! I can give you

ashepherd's picture

Happy to help! I can give you more specific examples/instructions if you can post what external data you want to link to. And if you know which vocabularies you would like to use for publishing your linked data, please post that too. I'll wait for your response before posting some examples.

hi!Thank you very much! I

chocolatehuanghai's picture

hi!Thank you very much!
I wonder if i can use drupal link two linked open data,like IBM had made DBpedia linked with data.gov.uk,but because it is done in 2011,so my drupal7.34 and other modules can't compatible,i must update,but when i update,i found many many mistakes,and the reson led to these mistakes is unknown.
Now,i used the latesd rdfx and sparql modules,and the external data i want to link are DBpedia, RDF Book Mashup and FOAF ,Geonames etc.The vocabularies i use are dc, foaf, gen, skos, frbr, bf etc.Thank you again!

The first thing you need to

ashepherd's picture

The first thing you need to do is check the versions of the modules you have. For rdfx you want to use the 7.x-2.x-dev version since it handles entities at rdfx_resource_uri() better than previous versions. This will come in handy if you ever use rdf_indexer.

Next setup your vocabulary mappings. You can declare your vocabularies at Admin > Configuration > Web Services > RDF Namespaces (admin/config/services/rdf/namespaces), or you can do this in code by implementing hook_rdf_namespaces(). If you've enabled RDF UI module (from rdfx) you can assign your mappings at Admin > Configuration > Web Services (admin/config/services/rdf). If you prefer to do this in code, you implement hook_rdf_mapping().

Once you have your Drupal entities mapped to vocabularies, then you can publish your Drupal data to the sparql endpoint. rdf_indexer + arc2_store is a huge improvement over the sparql module, and I would suggest using it, as it's extendable for publishing Drupal data to external triplestores too. But, if you just want a triplestore in your Drupal site, the arc2_store module works out-of-the-box along with rdf_indexer. Install both these modules instead of the sparql module.

Setup the SPARQL endpoint first, at Admin > Configuration > Web Services > ARC2 store settings (admin/config/services/arc2_store).

Then setup how Drupal will populate it with data, go to: Admin > Configuration > Search and Metadata > Search API (admin/config/search/search_api). [NOTE: Search API is a dependency of rdf_indexer, but it provides lots of helpful mechanisms for keeping your SPARQL endpoint updated with only the data you desire.] Add a new Server, select RDF indexer service as the Service class, then selecting your ARC2 SPARQL endpoint. Finally, add a new Search API Index (admin/config/search/search_api/add_index) to configure what content should be available at the SPARQL endpoint.

You mentioned linking to external datasets like DBPedia, etc. If you end up storing those links in your data, using the Link module, you'll need an rdfx patch (https://www.drupal.org/node/1273450).

Thank you very much!

chocolatehuanghai's picture

Thank you very much!

How to use data from this SPARQL endpoint

FrankH's picture

Hi there, not sure if I should start another discussion for this but it's the same question as the OP so here goes...

I am trying to include data from a SPARQL endpoint into an empty Drupal 7 site. I have set up the RDFx, RDF UI, evoc, ARC-2 and SPARQL modules, but I'm not quite sure what to do next. When I try to add my SPARQL endpoint at /admin/structure/sparql_registry/create, I get a PHP error.

I realise this is not a support forum so I won't post the error here but if you could give me an overview of the steps to include the following SPARQL endpoint I'd certainly appreciate it!

http://data.logainm.ie/sparql

Thanks!

Semantic Web

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: