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

📄 attributeuse.java

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

import oracle.xml.parser.schema.*;

import java.util.Vector;

import it.itc.ectrl.normkit.cnorm.impl.C_NormalisationImpl;
import it.itc.ectrl.normkit.common.*;

/**
 * Class representing a possible attribute occurence in a XML document compliant with currently processed XML Schema. This entity is used within the C-Normalisation process in order to define Normalisation Map based on XPath model.
 * @author Oliver Fodor (fodor@itc.it)
 */
public class AttributeUse {

    C_NormalisationImpl m_c_norm;
    XSDAttribute m_attribute;
    ElementUse m_parentElementUse;
    String m_XPathAbsolute;
    String m_XPathRelative;
    XSDNode m_attType;
    int m_hashCode;

    String m_nodeBridgeURI;

    XSDElement m_parentElement;

    public AttributeUse(XSDAttribute attributeDeclaration, C_NormalisationImpl c_norm, ElementUse parentElementUse) throws Exception {

        m_attribute = attributeDeclaration;
        m_c_norm = c_norm;
        m_hashCode = TransformationUtil.getHashCode(m_attribute);

        m_attType = m_attribute.getType();

        m_XPathRelative = "@" + m_attribute.getName();

        m_XPathAbsolute = parentElementUse.getXPath() + "/" + m_XPathRelative;
        m_parentElement = parentElementUse.getElement();
        m_parentElementUse = parentElementUse;

     }


    public void createNormMapEntries() throws Exception {

        int parentTypeHashCode = TransformationUtil.getHashCode(m_parentElement.getType());
        int elmHashCode = TransformationUtil.getHashCode(m_attribute);

        String byAttTypeNormalizedEntityURI = CNOVocabulary.URI_RDFS_LITERAL;
        String byParentTypeNormalizedEntityURI = m_c_norm.getNormalizedEntityFirstURI(parentTypeHashCode);
        String byAttNormalizedEntityURI = m_c_norm.getNormalizedEntityFirstURI(elmHashCode);

        String newPathBridgeURI;

        // add property node to map
        String targetPathURI = m_c_norm.addPropertyNodeToNormMap(byParentTypeNormalizedEntityURI, byAttNormalizedEntityURI, byAttTypeNormalizedEntityURI);

        // add pathbridge to map
        newPathBridgeURI = m_c_norm.addPathBridgeToNormMap(m_XPathRelative, targetPathURI);

        // add hasbridge to the bridge defined by parents element
        m_c_norm.addHasBridgeToNodeBridge(m_parentElementUse.getNodeBridgeURI(), newPathBridgeURI);
    }

}

⌨️ 快捷键说明

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