当前位置: 首页>>代码示例>>Java>>正文


Java OWLIndividual.getObjectPropertyValues方法代码示例

本文整理汇总了Java中org.semanticweb.owlapi.model.OWLIndividual.getObjectPropertyValues方法的典型用法代码示例。如果您正苦于以下问题:Java OWLIndividual.getObjectPropertyValues方法的具体用法?Java OWLIndividual.getObjectPropertyValues怎么用?Java OWLIndividual.getObjectPropertyValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.semanticweb.owlapi.model.OWLIndividual的用法示例。


在下文中一共展示了OWLIndividual.getObjectPropertyValues方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: extractService

import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
/**
 * Extracts data manipulation service information from the ontology.
 * 
 * @param service
 *            service individual found in ontology.
 * @param ontology
 *            searched ontology.
 * @return extracted data manipulation service.
 * @throws EntryCreationException
 *             should any problems with extraction of data manipulation service information occur.
 */
private DataManipulationService extractService(OWLIndividual service, OWLOntology ontology)
        throws EntryCreationException {
    DataManipulationService dataManipulationService = new DataManipulationService();
    Set<OWLIndividual> profiles = service.getObjectPropertyValues(ontologyManager.getOWLDataFactory()
            .getOWLObjectProperty(PRESENTS_PROPERTY_IRI), ontology);
    for (OWLIndividual profile : profiles) {
        String profilePath = profile.asOWLNamedIndividual().getIRI().getStart();
        profilePath = profilePath.substring(0, profilePath.length() - 1);
        OWLOntology profileOntology = ontologyManager.getOntology(IRI.create(profilePath));
        dataManipulationService.setIri(extractServiceIri(service));
        dataManipulationService.setName(extractServiceName(profile, profileOntology));
        dataManipulationService.setDescription(extractServiceDescription(profile, profileOntology));
        dataManipulationService.setType(extractServiceType(profile, profileOntology));
    }
    return dataManipulationService;
}
 
开发者ID:psnc-dl,项目名称:darceo,代码行数:28,代码来源:ServicesConstructorBean.java

示例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.");
}
 
开发者ID:psnc-dl,项目名称:darceo,代码行数:34,代码来源:TechnicalDescriptorConstructorBean.java

示例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.");
}
 
开发者ID:psnc-dl,项目名称:darceo,代码行数:32,代码来源:TechnicalDescriptorConstructorBean.java

示例4: extractTechnicalDescriptors

import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
/**
 * Extracts technical descriptors individuals from the grounding ontology.
 * 
 * @param grounding
 *            grounding individual found in ontology.
 * @return technical descriptors found in the grounding.
 */
private Set<OWLIndividual> extractTechnicalDescriptors(OWLIndividual grounding) {
    String groundingPath = grounding.asOWLNamedIndividual().getIRI().getStart();
    groundingPath = groundingPath.substring(0, groundingPath.length() - 1);
    Set<OWLIndividual> technicalDescs = grounding.getObjectPropertyValues(
        ontologyManager.getOWLDataFactory().getOWLObjectProperty(
            IRI.create("http://www.daml.org/services/owl-s/1.2/Grounding.owl#hasAtomicProcessGrounding")),
        ontologyManager.getOntology(IRI.create(groundingPath)));
    return technicalDescs;
}
 
开发者ID:psnc-dl,项目名称:darceo,代码行数:17,代码来源:ServicesConstructorBean.java

示例5: extractInformation

import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
@Override
public RdfSemanticDescriptor extractInformation(String descriptorUri, SemanticDescriptor semantic)
        throws EntryCreationException {
    OWLOntology ontology = null;
    boolean isModified = semantic.getId() != 0;
    try {
        ontology = ontologyManager.loadOntology(IRI.create(descriptorUri));
        OWLClass serviceClass = ontologyManager.getOWLDataFactory().getOWLClass(SERVICE_CLASS_IRI);
        Set<OWLIndividual> services = serviceClass.getIndividuals(ontology);
        semantic.setType(getType(descriptorUri));
        semantic.setLocationUrl(descriptorUri);
        semantic.setContext(ontology.getOntologyID().getOntologyIRI().toURI().toString());
        List<DataManipulationService> dataManipulationServices = new ArrayList<DataManipulationService>();
        for (OWLIndividual service : services) {
            DataManipulationService dataManipulationService = extractService(service, ontology);
            dataManipulationService.setSemanticDescriptor(semantic);
            Set<OWLIndividual> groundings = service.getObjectPropertyValues(ontologyManager.getOWLDataFactory()
                    .getOWLObjectProperty(SUPPORTS_PROPERTY_IRI), ontology);
            for (OWLIndividual grounding : groundings) {
                Set<OWLIndividual> technicalDescs = extractTechnicalDescriptors(grounding);
                for (OWLIndividual technicalDesc : technicalDescs) {
                    TechnicalDescriptor technical = extractTechnicalDescriptor(semantic, dataManipulationService,
                        technicalDesc);
                    if (isModified) {
                        technicalDescriptorDao.persist(technical);
                    }
                }
            }
            dataManipulationServices.add(dataManipulationService);
        }
        semantic.getDescribedServices().addAll(dataManipulationServices);

        return getRdfDataOfSemanticDescriptor(semantic, ontology);

    } catch (OWLOntologyCreationException e) {
        logger.error("Error caught", e);
        throw new EntryCreationException("Could not load ontology from the document under specified URI.", e);
    } finally {
        if (ontology != null) {
            ontologyManager.removeLoadedOntologies(ontology);
        }
    }
}
 
开发者ID:psnc-dl,项目名称:darceo,代码行数:44,代码来源:ServicesConstructorBean.java


注:本文中的org.semanticweb.owlapi.model.OWLIndividual.getObjectPropertyValues方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。