⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 propertynode.java

📁 normkit is a set of tools supporting ontology learning. from xml,xsd to rdfs.
💻 JAVA
字号:
package it.itc.ectrl.normkit.common.NormMapModel;

import java.util.*;

import edu.unika.aifb.kaon.api.KAONException;
import edu.unika.aifb.kaon.api.oimodel.*;

import it.itc.ectrl.normkit.common.*;


 /**
 * The PropertyNode is the group of one Concept, one valid Property for that concept, and valid range for that property.
 *
 * @author Nuno Silva   (Nuno.Silva@dei.isep.ipp.pt)
 * @author Oliver Fodor (fodor@itc.it)
 */

public class PropertyNode extends CNOEntity {

    String m_strURIConcept;
    String m_strURIProperty;
    String m_strURIObject;


    public PropertyNode(final NormMap normmap, Instance instance)
    {
        m_normmap = normmap;
	m_instance = instance;
    }


    public PropertyNode( NormMap normmap, String strURIConcept, String strURIProperty, String strURIObject ) throws Exception
    {
        m_normmap = normmap;

        m_strURIConcept = strURIConcept;
        m_strURIProperty = strURIProperty;
        m_strURIObject = strURIObject;

        m_instance = KAONUtils.addConceptInstanceToOIModel( m_normmap.m_oimodelCNOInstance,
                                                  CNOVocabulary.URI_CNO_PROPERTY_NODE,
                                                  m_normmap.m_oimodelCNOInstance.createNewURI() );

        addConceptAndPropertyToOIModel( m_strURIConcept, m_strURIProperty, m_strURIObject );
    }



    public void addConceptAndPropertyToOIModel( String strURIConcept, String strURIProperty, String strURIObject ) throws Exception
    {
        addPropertyValueToOIModel( CNOVocabulary.URI_CNO_RELATES_CONCEPT, strURIConcept );

        addPropertyValueToOIModel( CNOVocabulary.URI_CNO_RELATES_PROPERTY, strURIProperty );

        addPropertyValueToOIModel( CNOVocabulary.URI_CNO_RELATES_OBJECT, strURIObject );
    }



/*

    public void removeFromOIModel() throws Exception
    {
        KAONUtils.removeConceptInstanceFromOIModel( m_mapping.m_oimodelSBOInstance,
                                                    SBOVocabulary.URI_SBO_PROPERTY_NODE,
                                                    getURI() );
    }

*/

/*
----------------------------------- parsing methods --------------------------------------------
*/

    public void parse() throws Exception
    {
        super.parse();

        // Concept
        m_strURIConcept = Parsing.readUniquePropertyValue(m_instance, CNOVocabulary.URI_CNO_RELATES_CONCEPT,
                                                    		CNOErrors.ERROR_ONE_AND_ONLY_ONE_CONCEPT);

        // Property
        m_strURIProperty = Parsing.readUniquePropertyValue(m_instance, CNOVocabulary.URI_CNO_RELATES_PROPERTY,
													CNOErrors.ERROR_ONE_AND_ONLY_ONE_PROPERTY);

	// Object
	m_strURIObject = Parsing.readUniquePropertyValue(m_instance, CNOVocabulary.URI_CNO_RELATES_OBJECT,
												CNOErrors.ERROR_ONE_AND_ONLY_ONE_PROPERTY);
	}


/*
----------------------------------- helper methods --------------------------------------------
*/

    public boolean isEquivalent( PropertyNode pn )
    {
        String strURIProperty = pn.getURIProperty();
        String strURIConcept = pn.getURIConcept();
        String strURIObject = pn.getURIObject();

        if( strURIProperty.equals( getURIProperty() ) &&
            strURIConcept.equals( getURIConcept() ) &&
            strURIObject.equals( getURIObject() ) )
            return true;
        else
            return false;
    }


    /**
    * Checks if the PropertyNode represents and attribute, i.e. if the object is literal.
    *
    * @return           <code>true</code> if is object is literal
    */

    public boolean isAttributePropertyNode()
    {
        if( getURIObject().equals( CNOVocabulary.URI_RDFS_LITERAL ) )
            return true;
        else
            return false;
    }

/*
----------------------------------- getters & setters --------------------------------------------
*/


    public String getURIConcept()
    {
        return m_strURIConcept;
    }

    public String getURIProperty()
    {
        return m_strURIProperty;
    }

    public String getURIObject()
    {
        return m_strURIObject;
    }

    public void setURIConcept(String strURI ) {
        m_strURIConcept = strURI;
    }

    public void setURIProperty(String strURI ) {
        m_strURIProperty = strURI;
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -