Giter Site home page Giter Site logo

391assignment3's People

Contributors

nshillin avatar

Watchers

James Cloos avatar  avatar

391assignment3's Issues

Q5

In a plain text ASCII file called q5.txt write a query to find, for every city in Alberta that has a hospital, the name of the city, and the ratio of population over the number of hospitals, sorted in decreasing order of this ratio.

Q2

In a plain text ASCII file called q2.txt write a query to find all international airports in Canada, and the cities where they are located in.

Q8

Write a program, in a file called q8.XYZ, where XYZ is the appropriate extension of your chosen programming language, that:

reads in two parameters from the command line: (1) the name of a SQLite database to store the RDF graph and (2) a path to a file RDF triples in Turtle format
loads the RDF triples into the database

Q3

In a plain text ASCII file called q3.txt write a query to find the number of South American soccer players who (appear in Wikipedia and) have played for a club in the Spanish “La Liga” that has never been relegated, grouping by country.

Q7

Provide in a plain text ASCII file called q7.txt the SQL commands to create any indexes you find appropriate for your RDF store. Justify your choices. If you don’t think indexes are necessary, explain why.

Q4

In a plain text ASCII file called q4.txt write a query to find the number of World Cup Final matches played by every national soccer team who has played in more than 3 finals.

Q9

Write a program, in a file called q9.XYZ, where XYZ is the appropriate extension of your chosen programming language, that:

reads in two parameters from the command line: (1) the name of a SQLite database file containing an RDF graph and (2) a path to a file with a SPARQL query
prints the output of that query against that graph
For the sake of this assignment, you will deal with conjunctive SPARQL queries, without negation and without aggregations. At a minimum, your program must handle a fully specified query such as the one below, where the output is fully specified by variables that are used among the graph patterns.

PREFIX p:
SELECT ?v1 ?v2 ... ?vn
WHERE {
subj1 pred1 obj1 .
...
subjm predm objm
}
You can assume that:

There can be blank lines in the query file, consisting of zero or more space characters (e.g., \s or \t)
There can be zero or many PREFIX declarations, and that there will always be one SELECT ... WHERE statement in each query
Every PREFIX declaration comes in a separate line and before the SELECT statement
Every non-blank line inside the WHERE clause contains a single subj pred obj pattern or a single FILTER constraint
Every sub, pred, obj will be one of: a variable, a fully prefixed resource (predicate or entity), or a literal.
All literals in any query will be enclosed with double quotes, and only strings, integers, and decimal literals will be used.
If it helps, you may require that every variable in the SELECT appears in at least one pattern in the WHERE clause, and throw an error otherwise. Also, you can assume that every regex filter will be of the form: FILTER (regex(?v, "")), without any other operators.

How to test your code

You can test your code with Apache Jena, which is an open source system that includes a SPARQL query processor that operates on local files. The same query file should work identically in Jena and in your system.

Create a small test RDF graph and a separate query test file for each of the kinds of SPARQL queries in the assignment. You have to submit your test graph, and you may submit your test queries if you want.

If you want to test with the sample Edmonton.txt, the query test_a3.txt returns one result: dbr:Edmonton.

Marking breakdown

25 marks for handling a fully specified conjunctive query in SPARQL
9 marks for handling * instead of a variable list in the SELECT clause of the SPARQL query
3 marks for handling FILTER clause with numeric constraints
3 marks for handling FILTER clause with regex constraints

Q1

In a plain text ASCII file called q1.txt write a query to find which are the stadiums used by Italian soccer teams. Have the team and the stadium in the output. If available, output the capacity of the stadium as well.

Q0

In a plain text ASCII file called q0.txt write a query to find all lakes located in the Jasper National Park.

Q6

Design a relational schema to represent an RDF data graph. Write in a plain text ASCII file called q6.txt a short report with:

Your relational schema and the SQLite statements to create an empty database with that schema
A short (max 2 paragraphs) explanation of your strategy to convert the RDF data into a database according to that schema
An example of a short (say 10-20 triples) input RDF graph and the corresponding relational database; your example should include prefix declarations.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.