This is an automated email from the ASF dual-hosted git repository. afs pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/jena.git
commit 30b31bdaca9543a6c12e6e307103a86352c5eec1 Author: Andy Seaborne <[email protected]> AuthorDate: Wed Jun 24 21:34:22 2026 +0100 Constants for SPARQL versions --- .../org/apache/jena/sparql/vocabulary/SPARQL.java | 27 ++++++++ .../jena/sparql/vocabulary/SPARQLVersions.java | 79 ++++++++++++++++++++++ 2 files changed, 106 insertions(+) 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 0000000000..d2d2cfa831 --- /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 0000000000..483e583832 --- /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: <http://www.w3.org/ns/sparql#> + +## URIs for versions of SPARQL +## The rdfs:label corresponds to the constant defined in SPARQL Query Language. + + +sparql:version-1.2 a rdfs:Resource ; + rdfs:label "1.2" ; + rdfs:comment "Version 1.2." ; + rdfs:isDefinedBy <https://www.w3.org/ns/sparql> ; + rdfs:seeAlso <http://www.w3.org/TR/sparql12-query/> ; + . + +sparql:version-1.2-basic a rdfs:Resource ; + rdfs:label "1.2-basic" ; + rdfs:comment "Version 1.2-basic" ; + rdfs:isDefinedBy <https://www.w3.org/ns/sparql> ; + rdfs:seeAlso <http://www.w3.org/TR/sparql12-query/> ; + . + +sparql:version-1.1 a rdfs:Resource ; + rdfs:label "1.1" ; + rdfs:comment "Version 1.1" ; + rdfs:isDefinedBy <https://www.w3.org/ns/sparql> ; + dc:conformsTo <http://www.w3.org/TR/sparql11-query/> ; + . + +sparql:version-1.0 a rdfs:Resource ; + rdfs:label "1.0" ; + rdfs:comment "Version 1.0" ; + rdfs:isDefinedBy <https://www.w3.org/ns/sparql> ; + dc:conformsTo <http://www.w3.org/TR/sparql10-query/> ; + . + */ + + SPARQL_10(SPARQL.NS+"version-1.0", "1.0"), + SPARQL_11(SPARQL.NS+"version-1.1", "1.1"), + SPARQL_12_basic(SPARQL.NS+"version-1.2-basic", "1.2-basic"), + SPARQL_12(SPARQL.NS+"version-1.2", "1.2"); + + public final String uri; + public final Node term; + public final String label; + + SPARQLVersions(String uri, String label) { + this.uri = uri; + this.term = NodeFactory.createURI(uri); + this.label = label; + } +}
