Commit 7daae27e authored by Jay Jay Billings's avatar Jay Jay Billings
Browse files

Reorganized files and combined the projects.


Signed-off-by: default avatarJay Jay Billings <billingsjj@ornl.gov>
parent ef1694d9
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
......@@ -5,7 +5,19 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding/java=UTF-8
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.5
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
package org.eclipse.ice.tests.data.owl;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.eclipse.ice.tests.data.owl;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.RDFNode;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.rdf.model.Statement;
import org.apache.jena.rdf.model.StmtIterator;
import org.apache.jena.util.FileManager;
import org.apache.jena.query.Query;
import org.apache.jena.query.QueryExecution;
import org.apache.jena.query.QueryExecutionFactory;
import org.apache.jena.query.QueryFactory;
import org.apache.jena.query.QuerySolution;
import org.apache.jena.query.ResultSet;
import org.apache.jena.rdf.model.Literal;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.util.FileManager;
public class ExampleAPI_ICE_01 {
public static void main(String[] args) {
FileManager.get().addLocatorClassLoader(ExampleAPI_ICE_01.class.getClassLoader());
Model model = FileManager.get().loadModel("/home/bkj/ICEIII/ice/org.eclipse.ice.data.owl/test.rdf", null, "RDF/XML");
// String queryString = "PREFIX example: <http://example.org/>" +
// "PREFIX foaf: <h ttp://xmlns.com/foaf/0.1/>" +
// "SELECT * WHERE {" +
// "?person foaf:name ?x ." + "}";
// Query query = QueryFactory.create(queryString);
// QueryExecution qExec = QueryExecutionFactory.create(query,model);
// try {
// System.out.println("Testing queries.");
// ResultSet results = qExec.execSelect();
// while (results.hasNext()) {
// QuerySolution soln = results.nextSolution();
// Literal name = soln.getLiteral("x");
// System.out.println("name = " + name);
// }
// } finally {
// qExec.close();
// }
StmtIterator iter = model.listStatements();
try {
while ( iter.hasNext() ) {
Statement stmt = iter.next();
System.out.println(stmt.toString());
Resource s = stmt.getSubject();
Resource p = stmt.getPredicate();
RDFNode o = stmt.getObject();
// System.out.println(s.toString());
// System.out.println(p.toString());
// System.out.println(o.toString());
if ( s.isURIResource() ) {
System.out.print("URI");
} else if ( s.isAnon() ) {
System.out.print("blank");
}
if ( p.isURIResource() )
System.out.print(" URI ");
if ( o.isURIResource() ) {
System.out.print("URI");
} else if ( o.isAnon() ) {
System.out.print("blank");
} else if ( o.isLiteral() ) {
System.out.print("literal");
}
System.out.println();
}
} finally {
if ( iter != null ) iter.close();
}
}
}
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.eclipse.ice.tests.data.owl;
import java.util.Iterator;
import org.apache.jena.rdf.model.InfModel;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.reasoner.Reasoner;
import org.apache.jena.reasoner.ReasonerRegistry;
import org.apache.jena.reasoner.ValidityReport;
import org.apache.jena.reasoner.ValidityReport.Report;
import org.apache.jena.util.FileManager;
import org.topbraid.shacl.validation.ValidationUtil;
import org.topbraid.shacl.vocabulary.SH;
public class ExampleONT_02 {
public static void main(String[] args) {
FileManager.get().addLocatorClassLoader(ExampleONT_02.class.getClassLoader());
// FIXME! Needs to be rewritten to point to the right class loader and resources
// folder.
Model tbox = FileManager.get().loadModel("/home/bkj/ICEIII/ice/org.eclipse.ice.data.owl/" +
//"ice-owl.rdf", null,"RDF/XML"); // http://en.wikipedia.org/wiki/Tbox
"ice-owl.ttl", null, "TURTLE"); // http://en.wikipedia.org/wiki/Tbox
Reasoner reasoner = ReasonerRegistry.getOWLReasoner().bindSchema(tbox.getGraph());
Model abox = FileManager.get().loadModel("/home/bkj/ICEIII/ice/org.eclipse.ice.data.owl/" +
"test.ttl", null,"TURTLE"); // http://en.wikipedia.org/wiki/Abox
// "test.rdf", null, "RDF/XML"); // http://en.wikipedia.org/wiki/Abox
InfModel inf = ModelFactory.createInfModel(reasoner, abox);
ValidityReport validityReport = inf.validate();
System.out.println("----- Begin Jena Review -----");
if (!validityReport.isValid()) {
System.out.println("Inconsistent");
} else {
System.out.println("Valid");
}
Iterator<Report> iter = validityReport.getReports();
while (iter.hasNext()) {
Report report = iter.next();
System.out.println(report);
}
System.out.println("----- End Jena Review -----");
System.out.println("----- Begin TopBraid/SHACL Review -----");
Resource reportResource = ValidationUtil.validateModel(abox, tbox, true);
boolean conforms = reportResource.getProperty(SH.conforms).getBoolean();
if (!conforms) {
System.out.println("Inconsistent");
} else {
System.out.println("Valid");
}
System.out.println("----- End TopBraid/SHACL Review -----");
return;
}
}
<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>
<groupId>org.eclipse.ice</groupId>
<artifactId>org.eclipse.ice.data</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>org.eclipse.ice.data</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>apache-jena-libs</artifactId>
<type>pom</type>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>org.topbraid</groupId>
<artifactId>shacl</artifactId>
<version>1.1.0</version>
</dependency>
</dependencies>
</project>
package org.eclipse.ice.tests.data.owl;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
log4j.rootLogger=INFO, stdlog
log4j.appender.stdlog=org.apache.log4j.ConsoleAppender
log4j.appender.stdlog.layout=org.apache.log4j.PatternLayout
log4j.appender.stdlog.layout.ConversionPattern=%d{HH:mm:ss} %-5p %-25c{1} :: %m%n
log4j.logger.com.hp.hpl.jena=INFO
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment