Difference between revisions of "Lab: Group project ideas / SPARQL"

From Info216
Line 33: Line 33:
Redo all the above steps, this time writing a Python/RDFlib program.
Redo all the above steps, this time writing a Python/RDFlib program.
==Useful Links==
[https://wiki.uib.no/info216/index.php/About_the_programming_project About the programming project]
[https://wiki.uib.no/info216/index.php/File:S03-SPARQL-13.pdf Lecture Notes]
==Triples that you can base your queries on: (turtle format)==
==Triples that you can base your queries on: (turtle format)==
Line 112: Line 119:
==If you have more time...==
==Useful Links==
[https://wiki.uib.no/info216/index.php/About_the_programming_project About the programming project]
[https://wiki.uib.no/info216/index.php/File:S03-SPARQL-13.pdf Lecture Notes]

Revision as of 02:47, 31 January 2020

Lab 3: Group project ideas / SPARQL


  • Meeting with Andreas to discuss group project idea.
  • Setting up the Blazegraph graph database.
  • SPARQL queries and updates.

Meeting with Andreas

One group at the time will go and talk to Andreas Lothe Opdahl about their group project idea. This is an opportunity to get early feedback for the programming project that you will develop throughout the semester. The office of Andreas is in Room 609 on the 6th floor of the SV-building next door(Laurits Melzers house).

Remember, we have a wiki page (linked below) that describes details about the group project, including some example ideas.


Meanwhile you can start working on the tasks for the next lab which is about SPARQl and storage of triples in Blazegraph.

Download Blazegraph from here: https://blazegraph.com/

Open a web browser and goto http://localhost:3030 . You are now in contact with the Fuseki server you just started. Go to the control panel and choose the dataset /mydataset . You can now run SPARQL queries and updates and load RDF graphs from file into your SPARQL engine.

Use SPARQL Update's INSERT DATA operation to add triples to the default graph of /mydataset. You can use triples from the graphs you made in labs 2 and 3.

Write a SPARQL SELECT query to view all the triples in your graph. Write a CONSTRUCT query to do the same.

Use SPARQL Update's DELETE DATA to delete a triple. Run your SPARQL query again to check that the graph has changed.

Use INSERT DATA to add information about Sergio Pastor, who lives in 4 Carrer del Serpis, 46021 Valencia, Spain. he has a M.Sc. in computer from the University of Valencia from 2008. His areas of expertise include big data, semantic technologies and machine learning.

Write a SPARQL DELETE/INSERT update to change the name of "University of Valencia" to "Universidad de Valencia" whereever it occurs.

Write a SPARQL DESCRIBE query to get basic information about the University of Valencia.

Redo all the above steps, this time writing a Python/RDFlib program.

Useful Links

About the programming project

Lecture Notes

Triples that you can base your queries on: (turtle format)

@prefix ex: <http://example.org/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

ex:Cade a foaf:Person ;
    ex:address [ a ex:Address ;
            ex:city ex:Berkeley ;
            ex:country ex:USA ;
            ex:postalCode "94709"^^xsd:string ;
            ex:state ex:California ;
            ex:street "1516_Henry_Street"^^xsd:string ] ;
    ex:age 27 ;
    ex:characteristic ex:Kind ;
    ex:degree [ ex:degreeField ex:Biology ;
            ex:degreeLevel "Bachelor"^^xsd:string ;
            ex:degreeSource ex:University_of_California ;
            ex:year "2011-01-01"^^xsd:gYear ] ;
    ex:interest ex:Bird,
        ex:Travelling ;
    ex:married ex:Mary ;
    ex:meeting ex:Meeting1 ;
    ex:visit ex:Canada,
        ex:Germany ;
    foaf:knows ex:Emma ;
    foaf:name "Cade_Tracey"^^xsd:string .

ex:Mary a ex:Student,
        foaf:Person ;
    ex:age 26 ;
    ex:characteristic ex:Kind ;
    ex:interest ex:Biology,
        ex:Hiking .

ex:Emma a foaf:Person ;
    ex:address [ a ex:Address ;
            ex:city ex:Valencia ;
            ex:country ex:Spain ;
            ex:postalCode "46020"^^xsd:string ;
            ex:street "Carrer_de_la Guardia_Civil_20"^^xsd:string ] ;
    ex:age 26 ;
    ex:degree [ ex:degreeField ex:Chemistry ;
            ex:degreeLevel "Master" ;
            ex:degreeSource ex:University_of_Valencia ;
            ex:year "2015-01-01"^^xsd:gYear ] ;
    ex:expertise ex:Air_Pollution,
        ex:Waste_Management ;
    ex:interest ex:Bike_Riding,
        ex:Travelling ;
    ex:meeting ex:Meeting1 ;
    ex:visit ( ex:Portugal ex:Italy ex:France ex:Germany ex:Denmark ex:Sweden ) ;
    foaf:name "Emma_Dominguez"^^xsd:string .

ex:Meeting1 a ex:Meeting ;
    ex:date "August, 2014"^^xsd:string ;
    ex:involved ex:Cade,
        ex:Emma ;
    ex:location ex:Paris .

ex:Paris a ex:City ;
    ex:capitalOf ex:France ;
    ex:locatedIn ex:France .

ex:France ex:capital ex:Paris .