Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
Comp 318: Assignment 1     Comp 318: Assignment 1     Assignment 1: RDF, RDFS and SPARQL Published on March 6th, 2014 The first practical assignment consists of two main tasks. The first assesses your knowledge of RDF(S) as a modelling language. The second allows you to explore the practical use of the SPARQL query language and how to process SPARQL queries in Jena.  Jena is a Java framework for building Semantic Web and linked-data applications that provides a programmatic environment for RDF, RDFS, OWL and SPARQL. The solution to both tasks should be submitted electronically. In preparing the solution files and naming them please follow carefully the submission instructions given below. The assignment deadline is March 19th 2014, at 15.00. Task 1 - 30 marks 1.Write an RDF/RDFS graph (using the RDF Turtle syntax) representing the statements listed below about the following URIs - Person, Lecturer, AdminStaff, Module, teaches, manages, isInvolved, joe, ann, comp123: aPerson, Lecturer, AdminStaff, and Module are classes; bLecturer, and AdminStaff are subclasses of Person; cteaches, isInvolved and manages are properties; disInvolved has domain Lecturer and range Module; eteaches is a sub property of isInvolved; fmanages has domain AdminStaff and range Module; gjoe is a AdminStaff; hann is a Lecturer; iann teaches comp123; jann is involved in comp123. 2.Can you can model in RDFS the following statement "Lecturers are not Admin Staff"? If so, provide the Turtle representation of the statement, otherwise motivate your answer. 3.Given the graph G generated as answer to 1. in Task 1, verify if the following triple is entailed by G. Explain the answer. _:m rdf:type _:n . _:p rdfs:SubClass Person . Task 2 - 70 marks The second task consists in writing a Java programme that uses Jena to edit an RDF file and answers queries expressed in SPARQL. Your programme should consists of one class only, named BiblioQuery.java, that reads in a sample Semantic Web reading list, extends it by adding some more entries, prints out a list of the publications (one per line) and answers some SPARQL queries. The SW reading list file, readingList.rdf, is modelled according to the ontology specified in the file SWLit.rdf (a class SwLitMod.java is provided that include the constants for the classes, properties, and instances modelled in SWLit.rdf. This file and the rdf data files are accessible from VITAL). The programme should carry out the following tasks, in order: 1. Create programmatically statements corresponding to the following publications and add them to the reading list in readingList.rdf: b.NMGL01: Nathasha Noy, Deborah McGuinnes: Ontology Development 101: A Guide to Create Your First Ontology.  Technical Report KSL-01-05, 2001, URL: http://www.ksl.stanford.edu/people/dlm/papers/ontology-tutorial-noy-mcguinness.pdf c.HBL10: Jim Handler, Tim Berners-Lee: From the Semantic Web to social machines: A research challenge for AI on the World Wide Web, Artificial Intelligence, 174(2), pages: 156-161, 2010  URL: http://www.sciencedirect.com/science/article/pii/S0004370209001404 d.PB13: Heiko Paulheim, Christian Bizer: Type Inference on Noisy RDF Data.  In Proceedings of the 12th International Semantic Web Conference, ISWC 2013, pages 510-525, 2013 URL: http://link.springer.com/chapter/10.1007%2F978-3-642-41335-3_32 Use Jena to parse and modify the input files. Refer to the resources below to help you using Jena and setting up your project correctly on Eclipse (if you decide to use this editor). The inout files model multiple authors in an ordered list, using and and your code should be able to navigate the resulting Jena model accordingly. Each paper should have a URI, where the base is the namespace http://www.csc.liv.ac.uk/~valli/Comp318/recommendedReading.rdf and a local part formed by its citation key provided at the beginning of each entry (follow the examples in the file readingList.rdf). In order to complete the information according to the vocabulary specified in SWLit.rdf you might have to use some other resources like DBLP or Google Scholar. The publication type (InProceedings, TechnicalReport, etc) should conform to the usual ways of referencing publications, and you should try to identify the publication topic (but there is no need for you to read the paper). 1. Print the publications in your newly generated list one entry per line. The output should be of the form: pub key: author, author, ... , author: “title”, year, topic. 1.Formulate the following queries in SPARQL and execute them against the updated readingList.rdf file. Pretty print the results as in the Jena SPARQL tutorial. b.Find all the titles and the publication year of all the papers published at the Semantic Web Conference; c.Find all the journal articles published between 2001 and 2004; d.Verify if there is any book chapter; e.Retrieve all the titles of the papers that appear either in a journal or in a technical report. Hints Hints, suggestions and clarifications will appear in due course. Make sure you refresh often this page to ensure you are aware of possible changes. • Task 1.1: Adding a prefix to the resources represented in the graph is optional. • Task 2.1: For further suggestions regarding how to write/update an rdf file conforming to an RDF schema have a look at the following tutorial. If you have any problems downloading the files above, please access VITAL where copies of the files can be find in the Assignment 1 folder. Assignment Submission Assignments should be handed in electronically through the departmental coursework submission system.  For technical problems with the submission site please email either Dr. Tamma or Mr Shield. When submitting, check that you have adhered to the following list: 1. All of your code is contained in a single file. DO NOT use more than one file. The file's name MUST be 'BiblioQuery.java' (capital O and Q; lower-case everything else). This means that the main class name must also be 'BiblioQuery'. Save the file in a simple text file. 2. Your program should be written in Java, not some other language. 3. Your file should be a simple text file; it must not be compressed or encoded in any way. 1.Your program compiles and runs on the computer science department’s Windows system. If you have developed your code elsewhere (e.g. your home PC), port it to our system and perform a compile/check test before submission. It is your responsibility to check that you can log onto the department’s system well in advance of the submission deadline. 2.Your program does not bear undue resemblance to anybody else's! Electronic checks for code similarity will be performed on all submissions and instances of plagiarism will be severely dealt with. The rules on plagiarism and collusion are explicit: do not copy anything from anyone else’s code, do not let anyone else copy from your code and do not hand in 'jointly developed' solutions.  The only code you may make use of is that presented to you in lab exercises. 3.Submit the PDF file with the solution to your assignment task 1, the new readingList.rdf file  and the text file containing your Java code in a zip file called “Assignment1-YourSurname.zip”. Use the compression programs provided on the systems in the labs. If your file cannot be unzipped it will not be marked!. Useful resources: Slides on Jena http://www.csc.liv.ac.uk/~valli/Comp318/PDF/jena_slides.pdf Slides on SPARQL http://www.csc.liv.ac.uk/~valli/Comp318/PDF/ SPARQL specification http://www.w3.org/TR/rdf-sparql-query Jena SPARQL tutorial http://jena.sourceforge.net/ARQ/Tutorial/ Querying remote SPARQL services with ARQ http://jena.sourceforge.net/ARQ/sparql-remote.html A comprehensive JENA tutorial http://jena.sourceforge.net/tutorial/RDF_API/ A complete beginner's guide to starting a Jena project in Eclipse http://www.iandickinson.me.uk/articles/jena-eclipse-helloworld/ Marking Scheme: Below is the breakdown of the mark scheme for this assignment.  Each category will be judged on the correctness, efficiency and modularity of the code, as well as whether or not it compiles and produces the desired output. Task 1 - 30 marks Generation of the RDF graph in Turtle = 20 marks ; Whether the triple in 2. translates in RDFS = 5 marks; Simple entailment = 5 marks. Task 2 - 70 marks Definition of the correct SPARQL queries = 40 marks (10 marks each) Update of the original readingList.rdf file = 15 marks (5 marks each); Output formatting, comments, correctness of results  and layout= 5 marks; Implementation of the programme using Jena = 10 marks. Deadline 19/03/2014 at 3 pm Standard UoL late submission policy applies. This assignment contributes 10% to your overall mark for Comp 318. Learning outcomes covered: “Students should have an understanding of the basic formal methods and techniques for designing and implementing advanced web application” “Students should be able to apply specific methods and techniques in the design and development of an application of advanced web technology for a case study”