Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

SWT Lab 2

358 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

SWT Lab 2

  1. 1. + Remote access and Sesame Lab 1
  2. 2. + Disclaimer License This work is licensed under the Creative Commons Attribution-Share Alike 3.0 License http://creativecommons.org/licenses/by-sa/3.0/
  3. 3. + Lab Assignment 2 Use Sesame from Java (using Maven dependencies) to  Make a program that:  Creates an in-memory (not persistent) repository  Loads the triples from FSW Exercise 7.1  Computes the answers to the queries of exercise 7.4 and prints them out to the console  Computes and prints the the answers to the query: “SELECT all celestial bodies which do not have a satellite”
  4. 4. + Setting up Sesame dependencies in Maven  Add the Aduna repository to your maven configuration by copying the settings.xml file (in the shared google folder) to your own .m2 folder (located in your home directory). This configuration file will point maven to Sesame’s maven repository.  Add the following dependency to your pom.xml <dependency> <groupId>org.openrdf.sesame</groupId> <artifactId>sesame-runtime</artifactId> <version>2.6.1</version> </dependency>
  5. 5. + Jar with dependencies maven <build> <plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> replace this with the name of <archive> your main class <manifest> <mainClass>fully.qualified.MainClass</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-withdependencies</descriptorRef> </descriptorRefs> </configuration> </plugin> </plugins> </build>
  6. 6. + Jar with dependencies  Build using: mvn assembly:single  Clean your project before making the zip with mvn clean Note, you may get warnings about sl4j logs. Ignore these warnings when writing your program.

×