ServiceExtension.java revision 2
package examples;
/*
* Created on Jan 6, 2005
*/
/**
* Another example demonstrating the extensibility features of the API.
*
* This example shows how the default Service implementation can be extended to support
* custom defined extensions of the service.
*
* @author Michael Daenzer, University of Zurich
*
*/
public class ServiceExtension {
public static final URI baseURI = URI.create("http://www.ifi.unizh.ch/ddis/ont/owl-s/ServiceExtensionTest.owl#");
}
// Override the default Service converter to return ExtendedService descriptions
// Create a KB and an ontology
// create extended service
// Print the results
}
// Override the default Profile converter to return ExtendedProfile descriptions
// Create a KB
// use a reasoner that will understand class and property inheritance
// Load an example service description
Service s = (Service) kb.readService("http://www.ifi.unizh.ch/ddis/ont/owl-s/ServiceExtensionTest.owl#");
// Print the results
}
/**
* An extension to existing Profile implmentation to return contact information.
*
*/
public static class ExtendedService extends ServiceImpl {
"http://www.ifi.unizh.ch/ddis/ont/owl-s/ServiceExtensionTest.owl#additionalProperty")));
super(ind);
}
public String getAdditionalProperty() {
return getPropertyAsString(additionalProperty);
}
}
}
/**
* A simple converter that will wrap existing OWLIndividuals as ExtendedProfile objects.
* Very similar to the default Profile converter.
*
*/
public static class ExtendedServiceConverter implements OWLObjectConverter {
return (object instanceof OWLIndividual) &&
}
}
}
}
}