jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1481583 - in /jena/Scratch/AFS/Jena-Dev/trunk: .classpath src/reports/archive/Jena450_OntModelPrefixesWrite.java
Date Sun, 12 May 2013 15:25:40 GMT
Author: andy
Date: Sun May 12 15:25:39 2013
New Revision: 1481583

URL: http://svn.apache.org/r1481583
Log:
Align dev project to Jena 2.10.1

Added:
    jena/Scratch/AFS/Jena-Dev/trunk/src/reports/archive/Jena450_OntModelPrefixesWrite.java
Modified:
    jena/Scratch/AFS/Jena-Dev/trunk/.classpath

Modified: jena/Scratch/AFS/Jena-Dev/trunk/.classpath
URL: http://svn.apache.org/viewvc/jena/Scratch/AFS/Jena-Dev/trunk/.classpath?rev=1481583&r1=1481582&r2=1481583&view=diff
==============================================================================
--- jena/Scratch/AFS/Jena-Dev/trunk/.classpath (original)
+++ jena/Scratch/AFS/Jena-Dev/trunk/.classpath Sun May 12 15:25:39 2013
@@ -2,7 +2,7 @@
 <classpath>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.5/commons-codec-1.5.jar"
sourcepath="M2_REPO/commons-codec/commons-codec/1.5/commons-codec-1.5-sources.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/apache/jena/jena-iri/0.9.6-SNAPSHOT/jena-iri-0.9.6-SNAPSHOT.jar"
sourcepath="M2_REPO/org/apache/jena/jena-iri/0.9.6-SNAPSHOT/jena-iri-0.9.6-SNAPSHOT-sources.jar"/>
+	<classpathentry kind="var" path="M2_REPO/org/apache/jena/jena-iri/0.9.7-SNAPSHOT/jena-iri-0.9.7-SNAPSHOT.jar"
sourcepath="M2_REPO/org/apache/jena/jena-iri/0.9.7-SNAPSHOT/jena-iri-0.9.7-SNAPSHOT-sources.jar"/>
 	<classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"
sourcepath="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1-sources.jar"/>
 	<classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpclient/4.2.2/httpclient-4.2.2.jar"
sourcepath="M2_REPO/org/apache/httpcomponents/httpclient/4.1.2/httpclient-4.1.2-sources.jar"/>
 	<classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpcore/4.2.3/httpcore-4.2.3.jar"
sourcepath="M2_REPO/org/apache/httpcomponents/httpcore/4.1.3/httpcore-4.1.3-sources.jar"/>

Added: jena/Scratch/AFS/Jena-Dev/trunk/src/reports/archive/Jena450_OntModelPrefixesWrite.java
URL: http://svn.apache.org/viewvc/jena/Scratch/AFS/Jena-Dev/trunk/src/reports/archive/Jena450_OntModelPrefixesWrite.java?rev=1481583&view=auto
==============================================================================
--- jena/Scratch/AFS/Jena-Dev/trunk/src/reports/archive/Jena450_OntModelPrefixesWrite.java
(added)
+++ jena/Scratch/AFS/Jena-Dev/trunk/src/reports/archive/Jena450_OntModelPrefixesWrite.java
Sun May 12 15:25:39 2013
@@ -0,0 +1,61 @@
+/**
+ * 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 reports.archive;
+
+import com.hp.hpl.jena.ontology.OntModel ;
+import com.hp.hpl.jena.ontology.OntModelSpec ;
+import com.hp.hpl.jena.query.Dataset ;
+import com.hp.hpl.jena.query.ReadWrite ;
+import com.hp.hpl.jena.rdf.model.Model ;
+import com.hp.hpl.jena.rdf.model.ModelFactory ;
+import com.hp.hpl.jena.tdb.TDBFactory ;
+
+
+public class Jena450_OntModelPrefixesWrite {
+
+    public static void main(String... args)
+    {
+        Dataset dataset = TDBFactory.createDataset() ;
+
+        if ( true ) action(dataset, ReadWrite.WRITE, null) ;
+        action(dataset, ReadWrite.READ, null) ;
+        
+        String name = "http://example/model" ;
+        if ( false ) action(dataset, ReadWrite.WRITE, name) ;
+        action(dataset, ReadWrite.READ, name) ;
+
+    }
+
+    private static void action(Dataset dataset, ReadWrite mode, String name)
+    {
+        System.out.println("Start "+mode) ;
+        try {
+            dataset.begin(mode);
+            Model model = 
+                ( name == null ) ? dataset.getDefaultModel() : dataset.getNamedModel(name)
; 
+                OntModel omodel = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM,
model);
+                dataset.commit() ;
+                System.out.println("End "+mode) ;
+        } finally { 
+            dataset.end();
+        }
+
+    }
+
+}



Mime
View raw message