Difference between revisions of "Lab: Group Project Presentations 1"

Line 25: Line 25:
 
The most important part is that we need to import a SPARQLWrapper in order to connect to the SPARQL endpoint of Blazegraph.  
 
The most important part is that we need to import a SPARQLWrapper in order to connect to the SPARQL endpoint of Blazegraph.  
  
Remember, before you can program with Blazegraphm you have to make sure its running like we did in  [https://wiki.uib.no/info216/index.php/Lab:_SPARQL Lab 4].
+
Remember, before you can program with Blazegraphm you have to make sure its running like we did in  [https://wiki.uib.no/info216/index.php/Lab:_SPARQL Lab 4].  
Also, Make sure that the URL when you connect (like seen below) is the same as the one you receive form the commandline/web_interface when running the server.  
 
 
Now you will be able to program queries and updates.
 
Now you will be able to program queries and updates.
  
 
<syntaxhighlight>
 
<syntaxhighlight>
 +
#
 +
 
from SPARQLWrapper import SPARQLWrapper, JSON
 
from SPARQLWrapper import SPARQLWrapper, JSON
  
sparql = SPARQLWrapper("http://84.211.55.37:9999/blazegraph/sparql")
+
sparql = SPARQLWrapper("("http://localhost:9999/bigdata/sparql")")
  
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 09:29, 14 February 2020

Lab 5: Group Project Presentations

Topics

  • Group Presentations.
  • SPARQL programming in python with Blazegraph.


Presentations

Today you will be presenting your ideas for the group project in the lab. Andreas Opdahl will be present to give you further feedback and ideas.


Tasks (if we have additional time)

After the presentations you can start on the tasks for next week. These tasks are about programming SPARQL queries and inserts in a python program. Last week we added triples manually from the web interface.

However, sometimes we would rather want to program the insertion or updates of triples for our databases.


  • Redo all the steps from Lab 4, this time writing a Python/RDFlib program.


With Blazegraph

You can look at the python example page to see how to connect to your Blazegraph database in Python and how to perform some basic queries. The most important part is that we need to import a SPARQLWrapper in order to connect to the SPARQL endpoint of Blazegraph.

Remember, before you can program with Blazegraphm you have to make sure its running like we did in Lab 4. Now you will be able to program queries and updates.

#

from SPARQLWrapper import SPARQLWrapper, JSON

sparql = SPARQLWrapper("("http://localhost:9999/bigdata/sparql")")


Without Blazegraph