From 96d4c23e3ec0ce766953e0959062c5d5f90fca4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20R=C3=B6der?= Date: Thu, 18 Jan 2024 16:38:03 +0100 Subject: [PATCH] Added a class handling the namespace of errors. --- .../hobbit/vocab/HobbitErrorInstances.java | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/main/java/org/hobbit/vocab/HobbitErrorInstances.java diff --git a/src/main/java/org/hobbit/vocab/HobbitErrorInstances.java b/src/main/java/org/hobbit/vocab/HobbitErrorInstances.java new file mode 100644 index 0000000..8d21a85 --- /dev/null +++ b/src/main/java/org/hobbit/vocab/HobbitErrorInstances.java @@ -0,0 +1,65 @@ +/** + * This file is part of core. + * + * core is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * core is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with core. If not, see . + */ +package org.hobbit.vocab; + +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.ResourceFactory; + +/** + * HOBBIT namespace for error instances. + * + * @author Michael Röder (michael.roeder@uni-paderborn.de) + * + */ +public class HobbitErrorInstances { + + protected static final String uri = "http://w3id.org/hobbit/error-instance#"; + + /** + * returns the URI for this schema + * + * @return the URI for this schema + */ + public static String getURI() { + return uri; + } + + protected static final Resource resource(String local) { + return ResourceFactory.createResource(getErrorInstanceUri(local)); + } + + /** + * returns the error-instance resource given its ID + * + * @param instanceId the ID of the error instance + * @return the error instance resource + */ + public static Resource getErrorInstance(String instanceId) { + return resource(instanceId); + } + + /** + * returns the URI of an error instance given its ID + * + * @param instanceId the ID of the error instance + * @return the error instance URI + */ + public static String getErrorInstanceUri(String instanceId) { + return uri + instanceId; + } + +}