Package com.hp.hpl.jena.ontology

Examples of com.hp.hpl.jena.ontology.OntClass


        OntologyResourceHelper orh = engine.getOntologyResourceHelper();
        if (predicateName.equals("child")) {
            // find all child nodes of the parentMode
            for (DObject childObject : parentObject.getChildren()) {
                OntClass childClass = orh.createOntClassByCMSObject(childObject.getInstance());
                if (childClass != null) {
                    orh.addSubsumptionAssertion(parentClass, childClass);
                } else {
                    logger.warn("Failed to create OntClass for child object {} while processing CMS Object",
                        childObject.getName(), parentObject.getName());
                }
            }

        } else {
            // find the ranges of the predicate whose subject is parentNode
            for (DProperty property : parentObject.getProperties()) {
                DPropertyDefinition propDef = property.getDefinition();
                // propDef returns null if a * named property comes
                // TODO after handling * named properties, remove the null check
                if (propDef == null) {
                    logger.warn("Property definition could not be got for property {}", property.getName());
                    continue;
                }
                String propName = propDef.getName();
                if (propName.equals(predicateName) || propName.contains(predicateName)) {
                    List<CMSObject> referencedObjects = propertyBridgeProcessor.resolveReferenceNodes(
                        property, engine);
                    for (CMSObject o : referencedObjects) {
                        OntClass childClass = orh.createOntClassByCMSObject(o);
                        if (childClass != null) {
                            orh.addSubsumptionAssertion(parentClass, childClass);
                        } else {
                            logger.warn(
                                "Failed to create OntClass for referenced object {} while processing {}",
View Full Code Here


        }
    }

    private Individual processObject(DObject contentObject, MappingEngine engine) {
        OntologyResourceHelper orh = engine.getOntologyResourceHelper();
        OntClass primaryNodeClass = orh.createOntClassByReference(contentObject.getInstance()
                .getObjectTypeRef());
        if (primaryNodeClass == null) {
            logger.warn("Failed to create OntClass for reference {}", contentObject.getInstance()
                    .getObjectTypeRef());
            return null;
View Full Code Here

    private void createDecoratedObjectTypes(List<DObjectType> objectTypes, MappingEngine engine) {
        for (DObjectType objectType : objectTypes) {
            if (canProcess(objectType.getInstance(), null)) {
                try {
                    OntClass parentClass = processType(objectType, engine);
                    if (parentClass == null) {
                        continue;
                    }
                    processProperties(objectType, parentClass, engine);
View Full Code Here

        }
    }

    private OntClass processType(DObjectType objectType, MappingEngine engine) throws RepositoryAccessException {
        OntologyResourceHelper orh = engine.getOntologyResourceHelper();
        OntClass parentClass = orh.createOntClassByObjectTypeDefinition(objectType.getInstance());
        if (parentClass == null) {
            logger.warn("Failed create class from CMS Object {}", objectType.getName());
            return null;
        }
        List<DObjectType> children = objectType.getChildDefinitions();
        if (children != null) {
            for (DObjectType child : children) {
                OntClass childClass = orh.createOntClassByObjectTypeDefinition(child.getInstance());
                if (childClass != null) {
                    orh.addSubsumptionAssertion(parentClass, childClass);
                } else {
                    logger.warn("Failed to create OntClass for child object {} while processing type {}",
                        child.getName(), objectType.getName());
View Full Code Here

        if (annotation != null) {
            OntologyResourceHelper orh = engine.getOntologyResourceHelper();

            List<OntClass> referencedClasses = new ArrayList<OntClass>();
            for (CMSObject referenceObject : referencedNodes) {
                OntClass c = orh.createOntClassByCMSObject(referenceObject);
                if (c == null) {
                    logger.warn("Failed create OntClass for CMS object {}", referenceObject.getLocalname());
                    continue;
                }
                referencedClasses.add(c);
View Full Code Here

                return;
            }
            createReferencedIndividuals(containerIndividual, contentObject, property, referencedObjects, orh);

        } else if (annotation.equals(AnnotationType.INSTANCE_OF)) {
            OntClass parentClass;
            for (CMSObject parent : referencedObjects) {
                parentClass = orh.createOntClassByCMSObject(parent);
                if (parentClass == null) {
                    logger.warn("Failed to create OntClass for CMS Object {}", parent.getLocalname());
                    continue;
View Full Code Here

        } else {
            // work without bridge definitions
            for (DObject cmsObject : cmsObjects) {
                if (canProcess(cmsObject.getInstance(), null)) {
                    try {
                        OntClass parentClass = processObject(cmsObject, engine);
                        if (parentClass == null) {
                            continue;
                        }
                        processProperties(cmsObject, parentClass, engine);
View Full Code Here

        }
    }

    private OntClass processObject(DObject cmsObject, MappingEngine engine) throws RepositoryAccessException {
        OntologyResourceHelper orh = engine.getOntologyResourceHelper();
        OntClass parentClass = orh.createOntClassByCMSObject(cmsObject.getInstance());
        if (parentClass == null) {
            logger.warn("Failed create class from CMS Object {}", cmsObject.getName());
            return null;
        }

        List<DObject> children = cmsObject.getChildren();
        if (children != null) {
            for (DObject child : children) {
                OntClass childClass = orh.createOntClassByCMSObject(child.getInstance());
                if (childClass != null) {
                    orh.addSubsumptionAssertion(parentClass, childClass);
                } else {
                    logger.warn("Failed to create OntClass for child object {} while processing object {}",
                        child.getName(), cmsObject.getName());
View Full Code Here

    private void processConceptBridgeCreate(ConceptBridge conceptBridge,
                                            DObject cmsObject,
                                            MappingEngine engine) throws RepositoryAccessException {

        OntClass parentClass = processObject(cmsObject, engine);
        if (parentClass == null) {
            return;
        }
        processInnerBridges(conceptBridge, cmsObject, parentClass, engine);
    }
View Full Code Here

    }

    public void testClassJenaToOwl() {
        JenaToOwlConvert j2o = new JenaToOwlConvert();
        OntModel model = ModelFactory.createOntologyModel();
        OntClass jc = model.createClass(CLAZZ.toString());
        OWLClass wc = null;
        try {
            wc = j2o.ClassJenaToOwl(jc, RDFXML);
            if (wc == null) fail("Some problems accours");
            else {
                assertEquals(wc.getIRI().toURI().toString(), jc.getURI().toString());
            }
        } catch (Exception e) {
            e.printStackTrace();
            fail("Exception caugth");
        } finally {
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.ontology.OntClass

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.