diff --git a/jena-arq/src/main/java/org/apache/jena/riot/system/streammgr/JenaIOEnvironment.java b/jena-arq/src/main/java/org/apache/jena/riot/system/streammgr/JenaIOEnvironment.java index 5b432348239..e0d51dc9292 100644 --- a/jena-arq/src/main/java/org/apache/jena/riot/system/streammgr/JenaIOEnvironment.java +++ b/jena-arq/src/main/java/org/apache/jena/riot/system/streammgr/JenaIOEnvironment.java @@ -35,8 +35,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** Code for using the general facilities of the location mapper/ filemanager subsystem - * and set up for Jena usage. e.g. find a location mapper with RDf description. +/** + * Code for using the general facilities of the location mapper/ filemanager subsystem + * and set up for Jena usage. e.g. find a location mapper with RDf description. */ public class JenaIOEnvironment { diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/ResultSetGraphVocab.java b/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/ResultSetGraphVocab.java index 2a4d1c8a5cd..f986ad34c99 100644 --- a/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/ResultSetGraphVocab.java +++ b/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/ResultSetGraphVocab.java @@ -21,63 +21,58 @@ package org.apache.jena.sparql.vocabulary ; -import org.apache.jena.rdf.model.Model ; -import org.apache.jena.rdf.model.ModelFactory ; import org.apache.jena.rdf.model.Property ; import org.apache.jena.rdf.model.Resource ; - +import org.apache.jena.rdf.model.ResourceFactory; + /** - * Vocabulary definitions from result-set.n3 - * @author Auto-generated by schemagen on 10 Jun 2006 18:47 + * Vocabulary definitions from result-set.n3 */ public class ResultSetGraphVocab { - /**
The RDF model that holds the vocabulary terms
*/ - private static Model m_model = ModelFactory.createDefaultModel(); - - /**The namespace of the vocabulary as a string
*/ + /** The namespace of the vocabulary as a string */ public static final String NS = "http://www.w3.org/2001/sw/DataAccess/tests/result-set#"; - - /**The namespace of the vocabulary as a string
+ + /** The namespace of the vocabulary as a string * @see #NS */ public static String getURI() {return NS;} - - /**The namespace of the vocabulary as a resource
*/ - public static final Resource NAMESPACE = m_model.createResource( NS ); - - /**Boolean result
*/ - public static final Property p_boolean = m_model.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#boolean" ); - - /**Variable name
*/ - public static final Property value = m_model.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#value" ); - - /**Variable name
*/ - public static final Property variable = m_model.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#variable" ); - - /**Index for ordered result sets
*/ - public static final Property index = m_model.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#index" ); - - /**Multi-occurrence property associating a result solution (row) resource to - * a single (variable, value) binding
+ + /** The namespace of the vocabulary as a resource */ + public static final Resource NAMESPACE = ResourceFactory.createResource( NS ); + + /** Boolean result */ + public static final Property p_boolean = ResourceFactory.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#boolean" ); + + /** Variable name */ + public static final Property value = ResourceFactory.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#value" ); + + /** Variable name */ + public static final Property variable = ResourceFactory.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#variable" ); + + /** Index for ordered result sets */ + public static final Property index = ResourceFactory.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#index" ); + + /** Multi-occurrence property associating a result solution (row) resource to + * a single (variable, value) binding */ - public static final Property binding = m_model.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#binding" ); - - /**MultivaluedName of a variable used in the result set
*/ - public static final Property resultVariable = m_model.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#resultVariable" ); - - /**Number of rows in the result table
*/ - public static final Property size = m_model.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#size" ); - - public static final Property solution = m_model.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#solution" ); - - /**Class of things that represent a single (variable, value) pairing
*/ - public static final Resource ResultBinding = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#ResultBinding" ); - - /**Class of things that represent a row in the result table - one solution to - * the query
+ public static final Property binding = ResourceFactory.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#binding" ); + + /** MultivaluedName of a variable used in the result set */ + public static final Property resultVariable = ResourceFactory.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#resultVariable" ); + + /** Number of rows in the result table */ + public static final Property size = ResourceFactory.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#size" ); + + public static final Property solution = ResourceFactory.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#solution" ); + + /** Class of things that represent a single (variable, value) pairing */ + public static final Resource ResultBinding = ResourceFactory.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#ResultBinding" ); + + /** Class of things that represent a row in the result table - one solution to + * the query */ - public static final Resource ResultSolution = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#ResultSolution" ); - - /**Class of things that represent the result set
*/ - public static final Resource ResultSet = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#ResultSet" ); - + public static final Resource ResultSolution = ResourceFactory.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#ResultSolution" ); + + /** Class of things that represent the result set */ + public static final Resource ResultSet = ResourceFactory.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/result-set#ResultSet" ); + } diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/SPARQL.java b/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/SPARQL.java new file mode 100644 index 00000000000..d2d2cfa831a --- /dev/null +++ b/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/SPARQL.java @@ -0,0 +1,27 @@ +/* + * 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 + * + * https://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. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.apache.jena.sparql.vocabulary; + +public class SPARQL { + public static final String NS = "http://www.w3.org/ns/sparql#"; + +} diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/SPARQLVersions.java b/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/SPARQLVersions.java new file mode 100644 index 00000000000..483e583832a --- /dev/null +++ b/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/SPARQLVersions.java @@ -0,0 +1,79 @@ +/* + * 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 + * + * https://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. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.apache.jena.sparql.vocabulary; + +import org.apache.jena.graph.Node; +import org.apache.jena.graph.NodeFactory; + +public enum SPARQLVersions { +/* + +PREFIX sparql:The RDF model that holds the vocabulary terms
*/ - private static Model m_model = ModelFactory.createDefaultModel(); - - /**The namespace of the vocabulary as a string ({@value})
*/ + /** The namespace of the vocabulary as a string ({@value}) */ public static final String NS = "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#"; - - /**The namespace of the vocabulary as a string
+ + /** The namespace of the vocabulary as a string * @see #NS */ public static String getURI() {return NS;} - - /**The namespace of the vocabulary as a resource
*/ - public static final Resource NAMESPACE = m_model.createResource( NS ); - - public static final Property queryForm = m_model.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#queryForm" ); - - /**Indicates that while the test should pass, it may generate a warning.
*/ - public static final Property warning = m_model.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#warning" ); - - /**Contains a pointer to the associated issue on the RDF Data Access Working - * Group Tracking document.
+ + /** The namespace of the vocabulary as a resource */ + public static final Resource NAMESPACE = ResourceFactory.createResource( NS ); + + public static final Property queryForm = ResourceFactory.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#queryForm" ); + + /** Indicates that while the test should pass, it may generate a warning. */ + public static final Property warning = ResourceFactory.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#warning" ); + + /** Contains a pointer to the associated issue on the RDF Data Access Working + * Group Tracking document. */ - public static final Property issue = m_model.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#issue" ); - - /**Contains a reference to the minutes of the RDF Data Access Working Group where - * the test case status was last changed.
+ public static final Property issue = ResourceFactory.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#issue" ); + + /** Contains a reference to the minutes of the RDF Data Access Working Group where + * the test case status was last changed. */ - public static final Property approval = m_model.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#approval" ); - - public static final Property resultForm = m_model.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#resultForm" ); - - /**A human-readable summary of the test case.
*/ - public static final Property description = m_model.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#description" ); - - public static final Property status = m_model.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#status" ); - - /**Super class of all test status classes
*/ - public static final Resource Status = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#Status" ); - - /**Super class of all result forms
*/ - public static final Resource ResultForm = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#ResultForm" ); - - /**Super class of all query forms
*/ - public static final Resource QueryForm = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#QueryForm" ); - - /**Class of result expected to be from a SELECT query
*/ - public static final Resource resultResultSet = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#resultResultSet" ); - - /**Class of queries that are seeking a constructed graph
*/ - public static final Resource queryConstruct = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#queryConstruct" ); - - /**Class of queries that are seeking a yes/no question
*/ - public static final Resource queryAsk = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#queryAsk" ); - - /**Class of result expected to be a graph
*/ - public static final Resource resultGraph = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#resultGraph" ); - - /**Class of tests that have not been classified
*/ - public static final Resource NotClassified = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#NotClassified" ); - - /**Class of result expected to be a boolean
*/ - public static final Resource booleanResult = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#booleanResult" ); - - /**Class of tests that are Approved
*/ - public static final Resource Approved = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#Approved" ); - - /**Class of tests that have been Withdrawn
*/ - public static final Resource Withdrawn = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#Withdrawn" ); - - /**Class of tests that are Obsolete
*/ - public static final Resource Obsoleted = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#Obsoleted" ); - - /**Class of queries that are seeking a descriptive graph
*/ - public static final Resource queryDescribe = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#queryDescribe" ); - - /**Class of queries that are seeking variable bindings
*/ - public static final Resource querySelect = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#querySelect" ); - - /**Class of tests that are Rejected
*/ - public static final Resource Rejected = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#Rejected" ); - + public static final Property approval = ResourceFactory.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#approval" ); + + public static final Property resultForm = ResourceFactory.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#resultForm" ); + + /** A human-readable summary of the test case. */ + public static final Property description = ResourceFactory.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#description" ); + + public static final Property status = ResourceFactory.createProperty( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#status" ); + + /** Super class of all test status classes */ + public static final Resource Status = ResourceFactory.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#Status" ); + + /** Super class of all result forms */ + public static final Resource ResultForm = ResourceFactory.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#ResultForm" ); + + /** Super class of all query forms */ + public static final Resource QueryForm = ResourceFactory.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#QueryForm" ); + + /** Class of result expected to be from a SELECT query */ + public static final Resource resultResultSet = ResourceFactory.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#resultResultSet" ); + + /** Class of queries that are seeking a constructed graph */ + public static final Resource queryConstruct = ResourceFactory.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#queryConstruct" ); + + /** Class of queries that are seeking a yes/no question */ + public static final Resource queryAsk = ResourceFactory.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#queryAsk" ); + + /** Class of result expected to be a graph */ + public static final Resource resultGraph = ResourceFactory.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#resultGraph" ); + + /** Class of tests that have not been classified */ + public static final Resource NotClassified = ResourceFactory.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#NotClassified" ); + + /** Class of result expected to be a boolean */ + public static final Resource booleanResult = ResourceFactory.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#booleanResult" ); + + /** Class of tests that are Approved */ + public static final Resource Approved = ResourceFactory.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#Approved" ); + + /** Class of tests that have been Withdrawn */ + public static final Resource Withdrawn = ResourceFactory.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#Withdrawn" ); + + /** Class of tests that are Obsolete */ + public static final Resource Obsoleted = ResourceFactory.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#Obsoleted" ); + + /** Class of queries that are seeking a descriptive graph */ + public static final Resource queryDescribe = ResourceFactory.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#queryDescribe" ); + + /** Class of queries that are seeking variable bindings */ + public static final Resource querySelect = ResourceFactory.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#querySelect" ); + + /** Class of tests that are Rejected */ + public static final Resource Rejected = ResourceFactory.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#Rejected" ); + } diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/TestManifestUpdate_11.java b/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/TestManifestUpdate_11.java index 8bafb96c2d2..60bd8cccf59 100644 --- a/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/TestManifestUpdate_11.java +++ b/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/TestManifestUpdate_11.java @@ -22,63 +22,47 @@ package org.apache.jena.sparql.vocabulary ; /* CVS $Id: $ */ - + import org.apache.jena.rdf.model.* ; - + /** - * Vocabulary definitions from test-update.n3 - * @author Auto-generated by schemagen on 29 Oct 2010 17:36 + * Vocabulary definitions from test-update.n3 */ public class TestManifestUpdate_11 { - /**The RDF model that holds the vocabulary terms
*/ - private static Model m_model = ModelFactory.createDefaultModel(); - - /**The namespace of the vocabulary as a string
*/ - public static final String NS = "http://www.w3.org/2009/sparql/tests/test-update#"; - - /**The namespace of the vocabulary as a string
- * @see #NS */ - public static String getURI() {return NS;} - - /**The namespace of the vocabulary as a resource
*/ - public static final Resource NAMESPACE = m_model.createResource( NS ); - - /**Optional: data for the update test (i.e. default graph in the graph store - * prior or after the update, depending on whether used within mf:action or within - * mf:result)
+ + /** Optional: data for the update test (i.e. default graph in the graph store + * prior or after the update, depending on whether used within mf:action or within + * mf:result) */ - public static final Property data = m_model.createProperty( "http://www.w3.org/2009/sparql/tests/test-update#data" ); - - public static final Property graph = m_model.createProperty( "http://www.w3.org/2009/sparql/tests/test-update#graph" ); - - /**Optional: named-graph only data for the update test (i.e. named graph in the - * graph store prior or after the update, depending on whether used within mf:action - * or within mf:result)
+ public static final Property data = ResourceFactory.createProperty( "http://www.w3.org/2009/sparql/tests/test-update#data" ); + + public static final Property graph = ResourceFactory.createProperty( "http://www.w3.org/2009/sparql/tests/test-update#graph" ); + + /** Optional: named-graph only data for the update test (i.e. named graph in the + * graph store prior or after the update, depending on whether used within mf:action + * or within mf:result) */ - public static final Property graphData = m_model.createProperty( "http://www.w3.org/2009/sparql/tests/test-update#graphData" ); - - /**The update query to ask
*/ - public static final Property request = m_model.createProperty( "http://www.w3.org/2009/sparql/tests/test-update#request" ); - - /**The class of all SPARQL 1.1 Update results
*/ - public static final Resource Result = m_model.createResource( "http://www.w3.org/2009/sparql/tests/test-update#Result" ); - - /**The class of all SPARQL 1.1 Update evaluation tests
*/ - public static final Resource UpdateEvaluationTest = m_model.createResource( "http://www.w3.org/2009/sparql/tests/test-update#UpdateEvaluationTest" ); - - /**test failure, cf. http://www.w3.org/TR/sparql11-protocol/#update-fault-messages
*/ - public static final Resource graph_already_exists = m_model.createResource( "http://www.w3.org/2009/sparql/tests/test-update#graph-already-exists" ); - - /**test failure, cf. http://www.w3.org/TR/sparql11-protocol/#update-fault-messages
*/ - public static final Resource graph_does_not_exist = m_model.createResource( "http://www.w3.org/2009/sparql/tests/test-update#graph-does-not-exist" ); - - /**test failure, cf. http://www.w3.org/TR/sparql11-protocol/#update-fault-messages
*/ - public static final Resource malformed_update = m_model.createResource( "http://www.w3.org/2009/sparql/tests/test-update#malformed-update" ); - - /**test shall pass without failure
*/ - public static final Resource success = m_model.createResource( "http://www.w3.org/2009/sparql/tests/test-update#success" ); - - /**test failure, cf. http://www.w3.org/TR/sparql11-protocol/#update-fault-messages
*/ - public static final Resource update_request_refused = m_model.createResource( "http://www.w3.org/2009/sparql/tests/test-update#update-request-refused" ); - + public static final Property graphData = ResourceFactory.createProperty( "http://www.w3.org/2009/sparql/tests/test-update#graphData" ); + + /** The update query to ask */ + public static final Property request = ResourceFactory.createProperty( "http://www.w3.org/2009/sparql/tests/test-update#request" ); + + /** The class of all SPARQL 1.1 Update results */ + public static final Resource Result = ResourceFactory.createProperty( "http://www.w3.org/2009/sparql/tests/test-update#Result" ); + + /** test failure, cf. http://www.w3.org/TR/sparql11-protocol/#update-fault-messages */ + public static final Resource graph_already_exists = ResourceFactory.createResource( "http://www.w3.org/2009/sparql/tests/test-update#graph-already-exists" ); + + /** test failure, cf. http://www.w3.org/TR/sparql11-protocol/#update-fault-messages */ + public static final Resource graph_does_not_exist = ResourceFactory.createResource( "http://www.w3.org/2009/sparql/tests/test-update#graph-does-not-exist" ); + + /** test failure, cf. http://www.w3.org/TR/sparql11-protocol/#update-fault-messages */ + public static final Resource malformed_update = ResourceFactory.createResource( "http://www.w3.org/2009/sparql/tests/test-update#malformed-update" ); + + /** test shall pass without failure */ + public static final Resource success = ResourceFactory.createResource( "http://www.w3.org/2009/sparql/tests/test-update#success" ); + + /** test failure, cf. http://www.w3.org/TR/sparql11-protocol/#update-fault-messages */ + public static final Resource update_request_refused = ResourceFactory.createResource( "http://www.w3.org/2009/sparql/tests/test-update#update-request-refused" ); + } diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/TestManifestX.java b/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/TestManifestX.java index 6fcec736347..1b968b14a58 100644 --- a/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/TestManifestX.java +++ b/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/TestManifestX.java @@ -21,63 +21,66 @@ package org.apache.jena.sparql.vocabulary ; -import org.apache.jena.rdf.model.Model ; -import org.apache.jena.rdf.model.ModelFactory ; +import org.apache.jena.rdf.model.ResourceFactory; import org.apache.jena.rdf.model.Property ; import org.apache.jena.rdf.model.Resource ; /** More TestManifest */ public class TestManifestX { - /**The RDF model that holds the vocabulary terms
*/ - private static Model m_model = ModelFactory.createDefaultModel(); - - /**The namespace of the vocabulary as a string
*/ + /** The namespace of the vocabulary as a string */ public static final String NS = "http://jena.hpl.hp.com/2005/05/test-manifest-extra#"; - /**The namespace of the vocabulary as a string
+ /** The namespace of the vocabulary as a strings * @see #NS */ public static String getURI() {return NS;} - /**The namespace of the vocabulary as a resource
*/ - public static final Resource NAMESPACE = m_model.createResource( NS ); + /** The namespace of the vocabulary as a resource */ + public static final Resource NAMESPACE = ResourceFactory.createResource( NS ); + + /** Syntax of the query */ + public static final Property dataSyntax = ResourceFactory.createProperty( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#dataSyntax" ); + + /** Default type of a test */ + public static final Property defaultTestType = ResourceFactory.createProperty( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#defaultTestType" ); + + /** Include another manifest file. */ + public static final Property include = ResourceFactory.createProperty( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#include" ); + + /** Option for an action */ + public static final Property option = ResourceFactory.createProperty( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#option" ); + + /** Syntax of the query */ + public static final Property querySyntax = ResourceFactory.createProperty( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#querySyntax" ); - /**Syntax of the query
*/ - public static final Property dataSyntax = m_model.createProperty( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#dataSyntax" ); + /** Whether to create a text index */ + public static final Property textIndex = ResourceFactory.createProperty( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#textIndex" ); - /**Default type of a test
*/ - public static final Property defaultTestType = m_model.createProperty( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#defaultTestType" ); - /**Include another manifest file.
*/ - public static final Property include = m_model.createProperty( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#include" ); - /**Option for an action
*/ - public static final Property option = m_model.createProperty( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#option" ); - /**Syntax of the query
*/ - public static final Property querySyntax = m_model.createProperty( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#querySyntax" ); + /** Syntax tests which expect a parse failure */ + public static final Resource NegativeSyntaxTestARQ = ResourceFactory.createResource( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#NegativeSyntaxTestARQ" ); - /**Whether to create a text index
*/ - public static final Property textIndex = m_model.createProperty( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#textIndex" ); + /** Syntax tests (query) */ + public static final Resource PositiveSyntaxTestARQ = ResourceFactory.createResource( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#PositiveSyntaxTestARQ" ); - /**Syntax tests which expect a parse failure
*/ - public static final Resource NegativeSyntaxTestARQ = m_model.createResource( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#NegativeSyntaxTestARQ" ); + /** Syntax tests which expect a parse failure */ + public static final Resource NegativeUpdateSyntaxTestARQ = ResourceFactory.createResource( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#NegativeUpdateSyntaxTestARQ" ); - /**Syntax tests (query)
*/ - public static final Resource PositiveSyntaxTestARQ = m_model.createResource( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#PositiveSyntaxTestARQ" ); + /** Syntax tests (query) */ + public static final Resource PositiveUpdateSyntaxTestARQ = ResourceFactory.createResource( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#PositiveUpdateSyntaxTestARQ" ); - /**Syntax tests which expect a parse failure
*/ - public static final Resource NegativeUpdateSyntaxTestARQ = m_model.createResource( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#NegativeUpdateSyntaxTestARQ" ); - /**Syntax tests (query)
*/ - public static final Resource PositiveUpdateSyntaxTestARQ = m_model.createResource( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#PositiveUpdateSyntaxTestARQ" ); - /**The class of test that are Query tests (query, data, results)
*/ - public static final Resource TestQuery = m_model.createResource( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#TestQuery" ); + /** The class of test that are Query tests (query, data, results) */ + public static final Resource TestQuery = ResourceFactory.createResource( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#TestQuery" ); - /**Query serialization tests
*/ - public static final Resource TestSerialization = m_model.createResource( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#TestSerialization" ); + /** Query serialization tests */ + public static final Resource TestSerialization = ResourceFactory.createResource( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#TestSerialization" ); - /**Query test not to be run
*/ - public static final Resource TestSurpressed = m_model.createResource( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#TestSurpressed" ); + /** Query test not to be run */ + public static final Resource TestSurpressed = ResourceFactory.createResource( "http://jena.hpl.hp.com/2005/05/test-manifest-extra#TestSurpressed" ); + /** CSV Test (i.e query, with results in CSV) - an extension */ + public static final Resource CSVResultFormatTest = ResourceFactory.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#CSVResultFormatTest" ); } diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/TestManifest_11.java b/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/TestManifest_11.java index 7942933e05b..d560d7c7240 100644 --- a/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/TestManifest_11.java +++ b/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/TestManifest_11.java @@ -22,50 +22,29 @@ package org.apache.jena.sparql.vocabulary ; import org.apache.jena.rdf.model.* ; +import org.apache.jena.vocabulary.TestManifest; /** - * Vocabulary definitions from test-manifest-1_1.ttl - * @author Auto-generated by schemagen on 24 May 2012 18:37 + * Vocabulary definitions from test-manifest-1_1.ttl */ +@Deprecated(forRemoval = true) public class TestManifest_11 { - /**The RDF model that holds the vocabulary terms
*/ - private static Model m_model = ModelFactory.createDefaultModel(); - - /**The namespace of the vocabulary as a string
*/ - public static final String NS = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#"; - - /**The namespace of the vocabulary as a string
- * @see #NS */ - public static String getURI() {return NS;} - - /**The namespace of the vocabulary as a resource
*/ - public static final Resource NAMESPACE = m_model.createResource( NS ); - - /**CSV Test
*/ - public static final Resource CSVResultFormatTest = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#CSVResultFormatTest" ); - - /**A type of test specifically for syntax testing for SPARQL 1.1.
*/ - public static final Resource NegativeSyntaxTest11 = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#NegativeSyntaxTest11" ); - - /**A type of test specifically for syntax testing of SPARQL Update. Syntax tests - * are not required to have an associated result, only an action. Negative syntax - * tests are tests of which the result should be a parser error.
- */ - public static final Resource NegativeUpdateSyntaxTest11 = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#NegativeUpdateSyntaxTest11" ); - - /**A type of test specifically for syntax testing for SPARQL 1.1.
*/ - public static final Resource PositiveSyntaxTest11 = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#PositiveSyntaxTest11" ); - - /**A type of test specifically for syntax testing of SPARQL Update. Syntax tests - * are not required to have an associated result, only an action.
- */ - public static final Resource PositiveUpdateSyntaxTest11 = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#PositiveUpdateSyntaxTest11" ); - - /**A type of test specifically for query evaluation testing. Query evaluation - * tests are required to have an associated input dataset, a query, and an expected - * output dataset.
- */ - public static final Resource UpdateEvaluationTest = m_model.createResource( "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#UpdateEvaluationTest" ); - } + public static final String NS = TestManifest.NS; + + /** A type of test specifically for syntax testing for SPARQL 1.1. */ + @Deprecated(forRemoval = true) + public static final Resource PositiveSyntaxTest11 = ResourceFactory.createResource( NS+"PositiveSyntaxTest11" ); + + @Deprecated(forRemoval = true) + public static final Resource PositiveUpdateSyntaxTest11 = ResourceFactory.createResource( NS+"PositiveUpdateSyntaxTest11" ); + + /** A type of test specifically for syntax testing for SPARQL 1.1. */ + @Deprecated(forRemoval = true) + public static final Resource NegativeSyntaxTest11 = ResourceFactory.createResource( NS+"NegativeSyntaxTest11" ); + + @Deprecated(forRemoval = true) + public static final Resource NegativeUpdateSyntaxTest11 = ResourceFactory.createResource( NS+"NegativeUpdateSyntaxTest11" ); + +} diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/TestManifest_12.java b/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/TestManifest_12.java index 92ec0facffd..9fe90122f4e 100644 --- a/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/TestManifest_12.java +++ b/jena-arq/src/main/java/org/apache/jena/sparql/vocabulary/TestManifest_12.java @@ -27,17 +27,15 @@ /** * Additional or changed vocabulary for rdf-tests SPARQL area. */ +@Deprecated(forRemoval = true) public class TestManifest_12 { - /**The namespace of the vocabulary as a string
*/ + /** The namespace of the vocabulary as a string */ public static final String NS = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#"; + @Deprecated(forRemoval = true) public static final Resource PositiveSyntaxTest12 = ResourceFactory.createResource(NS+"PositiveSyntaxTest12"); + @Deprecated(forRemoval = true) public static final Resource NegativeSyntaxTest12 = ResourceFactory.createResource(NS+"NegativeSyntaxTest12"); - - public static final Resource PositiveUpdateSyntaxTest = ResourceFactory.createResource(NS+"PositiveUpdateSyntaxTest"); - - public static final Resource NegativeUpdateSyntaxTest = ResourceFactory.createResource(NS+"NegativeUpdateSyntaxTest"); - } diff --git a/jena-arq/src/main/java/org/apache/jena/system/G.java b/jena-arq/src/main/java/org/apache/jena/system/G.java index da96d5d472e..a9671b7f973 100644 --- a/jena-arq/src/main/java/org/apache/jena/system/G.java +++ b/jena-arq/src/main/java/org/apache/jena/system/G.java @@ -167,6 +167,14 @@ public static String asString(Node x) { return x.getLiteralLexicalForm(); } + /** Get a string, or null, assuming the node is an xsd:string literal. */ + public static String asOptionalString(Node x) { + if ( x == null ) + return null; + return asString(x); + } + + /** Does the graph match the s/p/o pattern? */ public static boolean contains(Graph graph, Node subject, Node predicate, Node object) { Objects.requireNonNull(graph, "graph"); diff --git a/jena-arq/src/test/java/org/apache/jena/arq/junit/OmittedTest.java b/jena-arq/src/test/java/org/apache/jena/arq/junit/OmittedTest.java index c8259fd1273..a30baf1ba9a 100644 --- a/jena-arq/src/test/java/org/apache/jena/arq/junit/OmittedTest.java +++ b/jena-arq/src/test/java/org/apache/jena/arq/junit/OmittedTest.java @@ -30,8 +30,7 @@ public class OmittedTest extends SkipTest { public final boolean verbose; public OmittedTest(ManifestEntry entry) { - super(entry); - this.verbose = false; + this(entry, false); } public OmittedTest(ManifestEntry entry, boolean verbose) { diff --git a/jena-arq/src/test/java/org/apache/jena/arq/junit/manifest/Manifest.java b/jena-arq/src/test/java/org/apache/jena/arq/junit/manifest/Manifest.java index 1d9d4958f4f..cd27a444e9e 100644 --- a/jena-arq/src/test/java/org/apache/jena/arq/junit/manifest/Manifest.java +++ b/jena-arq/src/test/java/org/apache/jena/arq/junit/manifest/Manifest.java @@ -67,12 +67,13 @@ public static Manifest parse(String filenameOrURI) { log.error("Error reading manifest: "+filenameOrURI); throw new TestSetupException("Error reading manifest: "+filenameOrURI); } - Manifest manifest = new Manifest(manifestRDF); + Manifest manifest = new Manifest(manifestRDF, filenameOrURI); return manifest; } - private Manifest(Graph manifestRDF) { - manifestGraph = manifestRDF; + private Manifest(Graph manifestRDF, String filenameOrURI) { + this.manifestGraph = manifestRDF; + this.filenameOrURI = filenameOrURI; manifest = getManifestNode(manifestGraph, filenameOrURI); parseManifest(); parseIncludes(); @@ -128,9 +129,10 @@ private void parseEntries() { items.forEach(entry->{ String testName = getLiteral(entry, TestManifest.name.asNode()); Node testType = G.getZeroOrOneSP(manifestGraph, entry, RDF.Nodes.type); - Node action = G.getZeroOrOneSP(manifestGraph, entry, TestManifest.action.asNode()); - Node result = G.getZeroOrOneSP(manifestGraph, entry, TestManifest.result.asNode()); - ManifestEntry manifestEntry = new ManifestEntry(this, entry, testName, testType, action, result); + String specVersion = G.asOptionalString(G.getZeroOrOneSP(manifestGraph, entry, TestManifest.specVersion.asNode())); + Node action = G.getZeroOrOneSP(manifestGraph, entry, TestManifest.action.asNode()); + Node result = G.getZeroOrOneSP(manifestGraph, entry, TestManifest.result.asNode()); + ManifestEntry manifestEntry = new ManifestEntry(this, entry, testName, testType, specVersion, action, result); entries.add(manifestEntry); }); } @@ -150,8 +152,7 @@ private void parseIncludes(Node property) { }); } - private void parseOneIncludesList(Node r) - { + private void parseOneIncludesList(Node r) { if ( r == null ) return; if ( r.equals(RDF.Nodes.nil) ) @@ -164,7 +165,7 @@ private void parseOneIncludesList(Node r) includedFiles.add(r.getURI()); return; } - if ( ! r.isBlank() ) + if ( !r.isBlank() ) return; // Blank node - assumed to be a list. List