Skip to content

Commit

Permalink
Added a class handling the namespace of errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelRoeder committed Jan 18, 2024
1 parent 0dd2e77 commit 96d4c23
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions src/main/java/org/hobbit/vocab/HobbitErrorInstances.java
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
*/
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&ouml;der ([email protected])
*
*/
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;
}

}

0 comments on commit 96d4c23

Please sign in to comment.