diff --git a/pom.xml b/pom.xml index 6d49bf905a560fa987ad21624d69d0aa7360b005..0ce6ef273a74739be4338590fadb4472ee7e8085 100644 --- a/pom.xml +++ b/pom.xml @@ -1,75 +1,91 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> - <groupId>com.kgshape.app</groupId> - <artifactId>kg-shape-project</artifactId> - <version>1.0-SNAPSHOT</version> + <groupId>com.kgshape.app</groupId> + <artifactId>kg-shape-project</artifactId> + <version>1.0-SNAPSHOT</version> - <name>kg-shape-project</name> - <!-- FIXME change it to the project's website --> - <url>http://www.example.com</url> + <name>kg-shape-project</name> + <!-- FIXME change it to the project's website --> + <url>http://www.example.com</url> - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <maven.compiler.source>1.7</maven.compiler.source> - <maven.compiler.target>1.7</maven.compiler.target> - </properties> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <maven.compiler.source>1.7</maven.compiler.source> + <maven.compiler.target>1.7</maven.compiler.target> + </properties> - <dependencies> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.11</version> - <scope>test</scope> - </dependency> - </dependencies> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.11</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.jena</groupId> + <artifactId>apache-jena-libs</artifactId> + <type>pom</type> + <version>4.2.0</version> + </dependency> + </dependencies> - <build> - <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --> - <plugins> - <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle --> - <plugin> - <artifactId>maven-clean-plugin</artifactId> - <version>3.1.0</version> - </plugin> - <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --> - <plugin> - <artifactId>maven-resources-plugin</artifactId> - <version>3.0.2</version> - </plugin> - <plugin> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.8.0</version> - </plugin> - <plugin> - <artifactId>maven-surefire-plugin</artifactId> - <version>2.22.1</version> - </plugin> - <plugin> - <artifactId>maven-jar-plugin</artifactId> - <version>3.0.2</version> - </plugin> - <plugin> - <artifactId>maven-install-plugin</artifactId> - <version>2.5.2</version> - </plugin> - <plugin> - <artifactId>maven-deploy-plugin</artifactId> - <version>2.8.2</version> - </plugin> - <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle --> - <plugin> - <artifactId>maven-site-plugin</artifactId> - <version>3.7.1</version> - </plugin> - <plugin> - <artifactId>maven-project-info-reports-plugin</artifactId> - <version>3.0.0</version> - </plugin> - </plugins> - </pluginManagement> - </build> + <build> + <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --> + <plugins> + <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle --> + <plugin> + <artifactId>maven-clean-plugin</artifactId> + <version>3.1.0</version> + </plugin> + <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --> + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <version>3.0.2</version> + </plugin> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.8.0</version> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.22.1</version> + </plugin> + <plugin> + <artifactId>maven-jar-plugin</artifactId> + <version>3.0.2</version> + </plugin> + <plugin> + <artifactId>maven-install-plugin</artifactId> + <version>2.5.2</version> + </plugin> + <plugin> + <artifactId>maven-deploy-plugin</artifactId> + <version>2.8.2</version> + </plugin> + <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle --> + <plugin> + <artifactId>maven-site-plugin</artifactId> + <version>3.7.1</version> + </plugin> + <plugin> + <artifactId>maven-project-info-reports-plugin</artifactId> + <version>3.0.0</version> + </plugin> + </plugins> + </pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>15</source> + <target>15</target> + </configuration> + </plugin> + </plugins> + </build> </project> diff --git a/src/main/java/com/kgshape/app/Query.java b/src/main/java/com/kgshape/app/Query.java new file mode 100644 index 0000000000000000000000000000000000000000..82f6c7c205a8f70b6b79b434392f5f6666fd2555 --- /dev/null +++ b/src/main/java/com/kgshape/app/Query.java @@ -0,0 +1,44 @@ +package com.kgshape.app; + +import org.apache.jena.query.*; +import org.apache.jena.rdf.model.ModelFactoryBase; + +/** + * See: https://jena.apache.org/documentation/query/app_api.html + */ +public class Query { + public static void main(String[] args) { + // Get 20 different languages + String example_sparql_query = """ + PREFIX o: <http://dbpedia.org/ontology/> + select distinct ?subj where {?subj a o:Language} LIMIT 20 + """; + String in_progress = """ + PREFIX o: <http://dbpedia.org/ontology/> + construct {?sub ?pred ?obj} + where { + ?sub a o:Actor; + ?pred ?obj + } LIMIT 100 + """; + // You can also open this endpoint in the browser and test the above query + String endpoint = "https://dbpedia.org/sparql"; + + // naming conflict, eh. + org.apache.jena.query.Query query = QueryFactory.create(example_sparql_query); + +// Model model = ModelFactoryBase... // dunno how to make query yet. Rest is compied from the example. +// +// try (QueryExecution qexec = QueryExecutionFactory.create(query, model)) { +// ResultSet results = qexec.execSelect(); +// for (; results.hasNext(); ) { +// QuerySolution soln = results.nextSolution(); +// RDFNode x = soln.get("varName"); // Get a result variable by name. +// Resource r = soln.getResource("VarR"); // Get a result variable - must be a resource +// Literal l = soln.getLiteral("VarL"); // Get a result variable - must be a literal +// } +// } + + System.out.println("Hello Query!"); + } +} diff --git a/target/classes/com/kgshape/app/App.class b/target/classes/com/kgshape/app/App.class deleted file mode 100644 index 1e036b1ee691e3f334ddf0905846fb6bab36ea05..0000000000000000000000000000000000000000 Binary files a/target/classes/com/kgshape/app/App.class and /dev/null differ diff --git a/target/kg-shape-project-1.0-SNAPSHOT.jar b/target/kg-shape-project-1.0-SNAPSHOT.jar deleted file mode 100644 index 3928d658f3bdee9561ccb32181044c3316258067..0000000000000000000000000000000000000000 Binary files a/target/kg-shape-project-1.0-SNAPSHOT.jar and /dev/null differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties deleted file mode 100644 index 10bd00ba0af8faa270a829dd01fd59b3a2289603..0000000000000000000000000000000000000000 --- a/target/maven-archiver/pom.properties +++ /dev/null @@ -1,4 +0,0 @@ -#Created by Apache Maven 3.8.3 -groupId=com.kgshape.app -artifactId=kg-shape-project -version=1.0-SNAPSHOT diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst deleted file mode 100644 index 7d16c252bce3e9e006773eace60fd550fce8ced6..0000000000000000000000000000000000000000 --- a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +++ /dev/null @@ -1 +0,0 @@ -com/kgshape/app/App.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst deleted file mode 100644 index 1dc2befa2d17f4fc78f3b9f8f647ba87ef770fa1..0000000000000000000000000000000000000000 --- a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +++ /dev/null @@ -1 +0,0 @@ -/Users/daniellemckenney/Documents/Documents - Minime/Uni Innsbruck/Courses/Current Topics/Project/kg-shape-project/src/main/java/com/kgshape/app/App.java diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst deleted file mode 100644 index 0725ba5e212bdd85b121fb85e40322c177ef34ec..0000000000000000000000000000000000000000 --- a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst +++ /dev/null @@ -1 +0,0 @@ -com/kgshape/app/AppTest.class diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst deleted file mode 100644 index 508f958a89c1e9551ed480cccc4ade5cbb674182..0000000000000000000000000000000000000000 --- a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst +++ /dev/null @@ -1 +0,0 @@ -/Users/daniellemckenney/Documents/Documents - Minime/Uni Innsbruck/Courses/Current Topics/Project/kg-shape-project/src/test/java/com/kgshape/app/AppTest.java diff --git a/target/surefire-reports/TEST-com.kgshape.app.AppTest.xml b/target/surefire-reports/TEST-com.kgshape.app.AppTest.xml deleted file mode 100644 index d1dca2d2d15ce64368c3633c617f99679a1b4358..0000000000000000000000000000000000000000 --- a/target/surefire-reports/TEST-com.kgshape.app.AppTest.xml +++ /dev/null @@ -1,59 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd" name="com.kgshape.app.AppTest" time="0.074" tests="1" errors="0" skipped="0" failures="0"> - <properties> - <property name="java.specification.version" value="17"/> - <property name="sun.jnu.encoding" value="UTF-8"/> - <property name="java.class.path" value="/Users/daniellemckenney/Documents/Documents - Minime/Uni Innsbruck/Courses/Current Topics/Project/kg-shape-project/target/test-classes:/Users/daniellemckenney/Documents/Documents - Minime/Uni Innsbruck/Courses/Current Topics/Project/kg-shape-project/target/classes:/Users/daniellemckenney/.m2/repository/junit/junit/4.11/junit-4.11.jar:/Users/daniellemckenney/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:"/> - <property name="java.vm.vendor" value="Homebrew"/> - <property name="sun.arch.data.model" value="64"/> - <property name="java.vendor.url" value="https://github.com/Homebrew/homebrew-core/issues"/> - <property name="os.name" value="Mac OS X"/> - <property name="java.vm.specification.version" value="17"/> - <property name="sun.java.launcher" value="SUN_STANDARD"/> - <property name="user.country" value="US"/> - <property name="sun.boot.library.path" value="/usr/local/Cellar/openjdk/17.0.1/libexec/openjdk.jdk/Contents/Home/lib"/> - <property name="sun.java.command" value="/Users/daniellemckenney/Documents/Documents - Minime/Uni Innsbruck/Courses/Current Topics/Project/kg-shape-project/target/surefire/surefirebooter2764028021535742154.jar /Users/daniellemckenney/Documents/Documents - Minime/Uni Innsbruck/Courses/Current Topics/Project/kg-shape-project/target/surefire 2021-11-12T13-25-23_651-jvmRun1 surefire14515042692933083292tmp surefire_07031737177945057139tmp"/> - <property name="http.nonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/> - <property name="jdk.debug" value="release"/> - <property name="surefire.test.class.path" value="/Users/daniellemckenney/Documents/Documents - Minime/Uni Innsbruck/Courses/Current Topics/Project/kg-shape-project/target/test-classes:/Users/daniellemckenney/Documents/Documents - Minime/Uni Innsbruck/Courses/Current Topics/Project/kg-shape-project/target/classes:/Users/daniellemckenney/.m2/repository/junit/junit/4.11/junit-4.11.jar:/Users/daniellemckenney/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:"/> - <property name="sun.cpu.endian" value="little"/> - <property name="user.home" value="/Users/daniellemckenney"/> - <property name="user.language" value="en"/> - <property name="java.specification.vendor" value="Oracle Corporation"/> - <property name="java.version.date" value="2021-10-19"/> - <property name="java.home" value="/usr/local/Cellar/openjdk/17.0.1/libexec/openjdk.jdk/Contents/Home"/> - <property name="file.separator" value="/"/> - <property name="basedir" value="/Users/daniellemckenney/Documents/Documents - Minime/Uni Innsbruck/Courses/Current Topics/Project/kg-shape-project"/> - <property name="java.vm.compressedOopsMode" value="Zero based"/> - <property name="line.separator" value=" "/> - <property name="java.specification.name" value="Java Platform API Specification"/> - <property name="java.vm.specification.vendor" value="Oracle Corporation"/> - <property name="surefire.real.class.path" value="/Users/daniellemckenney/Documents/Documents - Minime/Uni Innsbruck/Courses/Current Topics/Project/kg-shape-project/target/surefire/surefirebooter2764028021535742154.jar"/> - <property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/> - <property name="ftp.nonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/> - <property name="java.runtime.version" value="17.0.1+0"/> - <property name="user.name" value="daniellemckenney"/> - <property name="path.separator" value=":"/> - <property name="os.version" value="11.6"/> - <property name="java.runtime.name" value="OpenJDK Runtime Environment"/> - <property name="file.encoding" value="UTF-8"/> - <property name="java.vm.name" value="OpenJDK 64-Bit Server VM"/> - <property name="java.vendor.version" value="Homebrew"/> - <property name="localRepository" value="/Users/daniellemckenney/.m2/repository"/> - <property name="java.vendor.url.bug" value="https://github.com/Homebrew/homebrew-core/issues"/> - <property name="java.io.tmpdir" value="/var/folders/dx/9xjdddhn30jfw1p92r0hl5gh0000gn/T/"/> - <property name="java.version" value="17.0.1"/> - <property name="user.dir" value="/Users/daniellemckenney/Documents/Documents - Minime/Uni Innsbruck/Courses/Current Topics/Project/kg-shape-project"/> - <property name="os.arch" value="x86_64"/> - <property name="java.vm.specification.name" value="Java Virtual Machine Specification"/> - <property name="native.encoding" value="UTF-8"/> - <property name="java.library.path" value="/Users/daniellemckenney/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:."/> - <property name="java.vm.info" value="mixed mode, sharing"/> - <property name="java.vendor" value="Homebrew"/> - <property name="java.vm.version" value="17.0.1+0"/> - <property name="sun.io.unicode.encoding" value="UnicodeBig"/> - <property name="socksNonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/> - <property name="java.class.version" value="61.0"/> - </properties> - <testcase name="shouldAnswerWithTrue" classname="com.kgshape.app.AppTest" time="0.003"/> -</testsuite> \ No newline at end of file diff --git a/target/surefire-reports/com.kgshape.app.AppTest.txt b/target/surefire-reports/com.kgshape.app.AppTest.txt deleted file mode 100644 index 14b1835a34b4c23d8a731a4ee7349bf0443fc2a0..0000000000000000000000000000000000000000 --- a/target/surefire-reports/com.kgshape.app.AppTest.txt +++ /dev/null @@ -1,4 +0,0 @@ -------------------------------------------------------------------------------- -Test set: com.kgshape.app.AppTest -------------------------------------------------------------------------------- -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.074 s - in com.kgshape.app.AppTest diff --git a/target/test-classes/com/kgshape/app/AppTest.class b/target/test-classes/com/kgshape/app/AppTest.class deleted file mode 100644 index 1a212412c4aa923b1b657062b87c09827245e34a..0000000000000000000000000000000000000000 Binary files a/target/test-classes/com/kgshape/app/AppTest.class and /dev/null differ