public class GenericModelProfile implements ModelProfile
{
// note that this is not a complete example, it only shows a few terms to get the basic idea
// for a more complete example, reference the documentation.
// create the URL of our physical ontology
private static final String ONT_URL = "http://www.example.org/multimedia/digital-media.owl#";
// create a temporary model for us to create the actual terms with
private static final Model ONT_MODEL = ModelFactory.createDefaultModel();
// here we will define our classes in the ontology
// this first term will map with the Image concept
// and the second will match with the Region concept
private static final Resource Image = ONT_MODEL.createResource(ONT_URL+"Image");
private static final Resource Region = ONT_MODEL.createResource(ONT_URL+"ImagePart");
// here we will define some of the properties required by the ModelProfile
// that are in our ontology
private static final Property svgOutline = ONT_MODEL.createProperty(ONT_URL+"svgOutline");
private static final Property depicts = ONT_MODEL.createProperty(ONT_URL+"depicts");
private static final Property depiction = ONT_MODEL.createProperty(ONT_URL+"depiction");
private static final Property regionOf = ONT_MODEL.createProperty(ONT_URL+"regionOf");
private static final Property hasRegion = ONT_MODEL.createProperty(ONT_URL+"hasRegion");
// now that we've defined all the terms that correspond to the actual physical
// ontology, we need to start implementing the ModelProfile abstract methods
// the implementation of these methods will tell the API which concepts to use when
// the RDF is being generated.
public Property depicts() {
return depicts;
}
public Property depiction() {
return depiction;
}
public Property hasRegion() {
return hasRegion;
}
public Property regionOf() {
return regionOf;
}
public Property svgOutline() {
return svgOutline;
}
public Resource Image() {
return Image;
}
public Resource Region() {
return Region;
}
}
|