本文整理汇总了Java中org.semanticweb.owlapi.model.OWLIndividual.getDataPropertyValues方法的典型用法代码示例。如果您正苦于以下问题:Java OWLIndividual.getDataPropertyValues方法的具体用法?Java OWLIndividual.getDataPropertyValues怎么用?Java OWLIndividual.getDataPropertyValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.semanticweb.owlapi.model.OWLIndividual
的用法示例。
在下文中一共展示了OWLIndividual.getDataPropertyValues方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDescriptor
import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
/**
* Creates new technical descriptor from the given individual in the specified ontology.
*
* @param technicalDesc
* individual from the ontology representing technical descriptor.
* @param ontology
* currently browsed ontology.
* @param propertyIri
* IRI of the property containing technical descriptor.
* @param semantic
* constructed semantic descriptor tree root.
* @return extracted and constructed technical descriptor.
*/
private TechnicalDescriptor createDescriptor(OWLIndividual technicalDesc, OWLOntology ontology, IRI propertyIri,
SemanticDescriptor semantic) {
Set<OWLLiteral> locations = technicalDesc.getDataPropertyValues(ontologyManager.getOWLDataFactory()
.getOWLDataProperty(propertyIri), ontology);
TechnicalDescriptor result = new TechnicalDescriptor();
if (locations.size() != 1) {
throw new RuntimeException("Bad property specified or unsupported descriptor type.");
}
for (OWLLiteral location : locations) {
result.setLocationUrl(location.getLiteral().trim());
List<TechnicalDescriptor> technicalDescriptors = semantic.getTechnicalDescriptors();
for (TechnicalDescriptor technicalDescriptor : technicalDescriptors) {
if (technicalDescriptor.getLocationUrl().equals(location.getLiteral().trim())) {
return technicalDescriptor;
}
}
result.setSemanticDescriptor(semantic);
}
semantic.getTechnicalDescriptors().add(result);
return result;
}
示例2: getServiceUrlFromWsdl
import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
/**
* Finds the service address in the given WSDL using the information contained in semantic descriptor.
*
* @param ontology
* currently browsed ontology.
* @param technicalDesc
* individual from the ontology representing technical descriptor.
* @param techDescriptorUrl
* location of technical descriptor.
* @return URL specifying the service address (location).
* @throws EntryCreationException
* should any problems with parsing WSDL document occur.
*/
private String getServiceUrlFromWsdl(OWLOntology ontology, OWLIndividual technicalDesc, String techDescriptorUrl)
throws EntryCreationException {
Set<OWLIndividual> operationRefs = technicalDesc.getObjectPropertyValues(ontologyManager.getOWLDataFactory()
.getOWLObjectProperty(IRI.create(WSDL_GROUNDING_PREFIX + "wsdlOperation")), ontology);
for (OWLIndividual operationRef : operationRefs) {
Set<OWLLiteral> operations = operationRef.getDataPropertyValues(ontologyManager.getOWLDataFactory()
.getOWLDataProperty(IRI.create(WSDL_GROUNDING_PREFIX + "operation")), ontology);
for (OWLLiteral operation : operations) {
String[] split = operation.getLiteral().split("#");
String id = split[split.length - 1].trim();
String xpath = "//" + TechnicalNamespaceContext.WSDL_PREFIX + ":service/"
+ TechnicalNamespaceContext.WSDL_PREFIX + ":port/" + TechnicalNamespaceContext.WSDL_SOAP_PREFIX
+ ":address";
NodeList nodes = getNode(techDescriptorUrl, xpath);
String path = findOperationUrl(techDescriptorUrl, nodes, id);
return path;
}
}
throw new EntryCreationException("Could not find location of the service specified in grounding.");
}
示例3: getServiceUrlFromWadl
import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
/**
* Finds the service address in the given WADL using the information contained in semantic descriptor.
*
* @param ontology
* currently browsed ontology.
* @param technicalDesc
* individual from the ontology representing technical descriptor.
* @param techDescriptorUrl
* location of technical descriptor.
* @return URL specifying the service address (location).
* @throws EntryCreationException
* should any problems with parsing WADL document occur.
*/
private String getServiceUrlFromWadl(OWLOntology ontology, OWLIndividual technicalDesc, String techDescriptorUrl)
throws EntryCreationException {
Set<OWLIndividual> resourceMethods = technicalDesc.getObjectPropertyValues(ontologyManager.getOWLDataFactory()
.getOWLObjectProperty(IRI.create(WADL_GROUNDING_PREFIX + "wadlResourceMethod")), ontology);
for (OWLIndividual resourceMethod : resourceMethods) {
Set<OWLLiteral> resources = resourceMethod.getDataPropertyValues(ontologyManager.getOWLDataFactory()
.getOWLDataProperty(IRI.create(WADL_GROUNDING_PREFIX + "resource")), ontology);
for (OWLLiteral resource : resources) {
String[] split = resource.getLiteral().split("#");
String id = split[split.length - 1].trim();
String xpath = "//" + TechnicalNamespaceContext.WADL_PREFIX + ":resource[@id='" + id + "']";
NodeList nodes = getNode(techDescriptorUrl, xpath);
String path = constructUrl(nodes.item(0));
return path;
}
}
throw new EntryCreationException("Could not find location of the service specified in grounding.");
}
示例4: extractServiceName
import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
/**
* Extracts service name from profile ontology.
*
* @param profile
* profile individual found in ontology.
* @param profileOntology
* searched profile ontology.
* @return extracted service name.
* @throws EntryCreationException
* should any problems with extraction of data manipulation service information occur.
*/
private String extractServiceName(OWLIndividual profile, OWLOntology profileOntology)
throws EntryCreationException {
Set<OWLLiteral> names = profile.getDataPropertyValues(
ontologyManager.getOWLDataFactory().getOWLDataProperty(
IRI.create("http://www.daml.org/services/owl-s/1.2/Profile.owl#serviceName")), profileOntology);
for (OWLLiteral name : names) {
return name.getLiteral();
}
throw new EntryCreationException(
"Could not find service name in profile ontology - malformed semantic descriptor.");
}
示例5: extractServiceDescription
import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
/**
* Extracts service name of described service.
*
* @param profile
* profile individual found in ontology.
* @param profileOntology
* profile ontology.
* @return extracted service description.
*/
private String extractServiceDescription(OWLIndividual profile, OWLOntology profileOntology) {
Set<OWLLiteral> descriptions = profile.getDataPropertyValues(ontologyManager.getOWLDataFactory()
.getOWLDataProperty(IRI.create("http://www.daml.org/services/owl-s/1.2/Profile.owl#textDescription")),
profileOntology);
for (OWLLiteral description : descriptions) {
return description.getLiteral();
}
return null;
}
示例6: getPublicationCount
import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
public int getPublicationCount(OWLOntology onto, OWLNamedIndividual indiv){
OWLObjectProperty author_of = onto.getOWLOntologyManager().getOWLDataFactory().
getOWLObjectProperty(IRI.create("http://islab.di.unimi.it/imoaei2015#author_of"));
OWLDataProperty publication_count = onto.getOWLOntologyManager().getOWLDataFactory().
getOWLDataProperty(IRI.create("http://islab.di.unimi.it/imoaei2015#publication_count"));
Set<OWLIndividual> publications = indiv.getObjectPropertyValues(author_of, onto);
Set<OWLLiteral> data_values;
try {
//They have not been grouped or there are not publications
if (publications.size()>1 || publications.isEmpty()){
return publications.size();
}
for (OWLIndividual pub : publications){
data_values = pub.getDataPropertyValues(publication_count, onto);
for (OWLLiteral value : data_values){
//if (value.isInteger()){
return value.parseInteger();
//}
}
}
return 1;
}
catch (Exception e){
LogOutput.printError("Error extracting information about publications.");
return 0;
}
}