Giter Site home page Giter Site logo

alligator's Introduction

Alligator: A Deductive Approach for the Integration of Industry 4.0 Standards

This project contains the rules to integrate two AML files using a cannonical model and rules written in ProLog - Rules4AMLIntegrator.

Dependencies

This tool depends on the following software

  • Prolog 7.2.3
  • JDK 1.8
  • Prolog Connector 3.1.2
  • Hermit OWL Reasoner
  • OWL API

Download Prolog: http://www.swi-prolog.org/download/stable Donwload Prolog Connector: https://sewiki.iai.uni-bonn.de/research/pdt/connector/library Donwload Hermit OWL Reasoner: http://www.hermit-reasoner.com/download.html Donwload OWL API: https://sourceforge.net/projects/owlapi/

IDE support

The quick and easy way to start compiling, running and coding Rules4AMLIntegrator we provide a java project in Eclipse and we a Prolog Connector. Thus, you need to install tools:

In windows you need to add the following entries system PATH

$ C:\Program Files\swipl\bin; C:\Program Files\swipl\lib\jpl.jar; C:\PrologConnectorJarFolder\org.cs3.prolog.connector_3.1.2.201504300958.jar;

Install and build from the source code

To obtain the latest version of the project please clone the github repository

$ git clone https://github.com/i40-Tools/Alligator.git

Make sure to add resources/ and libs/ folder to your build path.

Running the examples

To run the examples please create a file config.ttl in the main directory of the project. An example is show below:

@prefix aml:     <https://w3id.org/i40/aml#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema:  <http://schema.org/> .
@prefix skos:    <http://www.w3.org/2004/02/skos/core#> .
@prefix xml:     <http://www.w3.org/XML/1998/namespace> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix uri:     <http://uri4uri.net/vocab.html/#>

aml:conf 
     rdfs:label "General Configuration"@en ;
     uri:path "C:/HeterogeneityExampleData/AutomationML/Single-Heterogeneity/M2/Testbeds-2/";
	 uri:experimentFolder "E:/ExperimentsToKCAP/Experiment1/run -1/";
     sto:Standard "aml";
     ontosec:Training "false";
     uri:NegativeRules "true";
     uri:URI "C:/Experiments/SemCPS-/resources/".     

Please note:

uri:path refers to Heterogeneity path                    
uri:URI refers to the ontology path
Negative rules true to user orignal.
false to use emulation.

Just give path of AML heterogenity and folders will be created automatically.


## Updating Krextor Rules 
### What is Krextor?

Krextor is a an extensible XSLT-based framework for extracting RDF from XML.                 

Read more at : https://github.com/EIS-Bonn/krextor

Please navigate to /resources/amlrules/aml.xsl

Here you can update, remove or add rules for RDF conversion.


## License

* Copyright (C) 2015-2016 EIS Uni-Bonn
* Licensed under the Apache License

alligator's People

Contributors

collarad avatar igrangel avatar omarrana avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

alligator's Issues

Integration Algorithm Improvement

Current integration Algorithm is implemented.

seed 1:
1- Copy seed1 as it is in integration.aml

seed 2:
Nodes that have attributes.
e.g <Aml attribute ="121></>
2- CompareConflicts in output.txt 
       -    If found check if seed 1 has already put that in integration.aml (will always be true)
       -    Found nodes would be ignored for further processing.
3-compareNonConflicts,
       -   Elements not found in output.txt must be merged with integration.aml
       -   Attributes are matched in integration.aml
       -   Matching Elements will have its Nodes, and Ancestor Nodes match in integration.aml
       -   Matching Elements will be ignored for further processing.
4- addNonConflicts
      -   Elements not matchin no Conflicts will be added into integration.aml
      -   Appended under its parent.

Nodes that have Value.
e.g <Aml>Value</>
5- CompareConflicts in output.txt 
       -    If found check if seed 1 has already put that in integration.aml (will always be true)
       -    Found nodes would be ignored for further processing.
6-compareNonConflicts,
       -   Elements not found in output.txt must be merged with integration.aml
       -   Node are matched in integration.aml
       -   Matching Elements will have Ancestor Nodes match in integration.aml
       -   Matching Elements will be ignored for further processing.
7- addNonConflicts
      -   Elements not matching no Conflicts will be added into integration.aml
      -   Appended under its parent.

Best Practices

Code needed to be split for better readability.

public class Integration {
public ArrayList<Node> integrationNodes;
public ArrayList<Node> seedNodes;
private static XPathFactory xpf;
private static XPath xpath;
/**
* This method integrates the two AML files.
*
* @throws Throwable
*/
public void integrate() throws Throwable {
// arrayList to hold nodes for integration and orignal files.
integrationNodes = new ArrayList<>();
seedNodes = new ArrayList<>();
// reads one of AML file contents
String contents = FileUtils.readFileToString(new File(ConfigManager.getFilePath() + "/seed-Granularity-1.aml"),
"UTF-8");
// One of the AML file will have its contents copied as it is.
PrintWriter prologWriter = new PrintWriter(new File(ConfigManager.getFilePath() + "/integration.aml"));
prologWriter.println(contents);
prologWriter.close();
// Get the output.txt contents which show matching elements.
// using XPath for XML
xpf = XPathFactory.newInstance();
xpath = xpf.newXPath();
// initializing documents.
Document seed = DocumentBuilderFactory.newInstance().newDocumentBuilder()
.parse(new InputSource(ConfigManager.getFilePath() + "/seed-Granularity-0.aml"));
Document integration = DocumentBuilderFactory.newInstance().newDocumentBuilder()
.parse(new InputSource(ConfigManager.getFilePath() + "/integration.aml"));
// Queries both documents to get All attribute values.
NodeList nodes = (NodeList) xpath.evaluate("//*/@*", seed, XPathConstants.NODESET);
NodeList nodes2 = (NodeList) xpath.evaluate("//*/@*", integration, XPathConstants.NODESET);
// stores all the attributes in arrayList
setNodes(nodes, 1);
setNodes(nodes2, 2);
// looping through the seedNode which will be compared to matching
// elements in output.txt
for (int i = 0; i < seedNodes.size(); i++) {
// flag to check if the attribute value is inside matching elements.
int flag = 0;
// loops through all its element.
for (int k = 0; k < DeductiveDB.attrName.size(); k++) {
if (seedNodes.get(i).getTextContent().equals(DeductiveDB.attrName.get(k))) {
// if match is found
flag = 1;
}
if (seedNodes.get(i).getNodeName().equals("FileName")) {
// not in output.txt
flag = 1;
}
}
// we are interested if its not in output.txt
// we need to add non matching elements to the integration file.
// all matching elements were already included when we copied one of
// the seed files.
if (flag == 0) {
// check tells if the non matching elements are already inside
// xml or not
int check = 0;
// for every node in Integration File compare the seed nodes.
for (int j = 0; j < integrationNodes.size(); j++) {
// compares the attribute Node with its values
if (seedNodes.get(i).getTextContent().equals(integrationNodes.get(j).getTextContent())) {
// compares the attribute Node with Node name
if (seedNodes.get(i).getNodeName().equals(integrationNodes.get(j).getNodeName())) {
// compares its Node and Parent node for semantic
// equality.
if (checkAttributeNode(seedNodes.get(i).getTextContent(), seed,
integrationNodes.get(j).getTextContent(), integration)) {
// if all test passes we can say its already in
// the integration document. we can ignore it.
check = 1;
}
}
}
}
// if the node is not in integration file we should add it.
if (check != 1) {
// we get the Node of the attribute Value which is not
// found.
NodeList list = getAttributeNode(seedNodes.get(i).getTextContent(), seed);
// we find its parent node so we can append it under it.
for (int m = 0; m < list.getLength(); m++) {
// matches the parent in the integration document.
NodeList integ = (NodeList) xpath.evaluate("//" + list.item(m).getParentNode().getNodeName(),
integration, XPathConstants.NODESET);
// now we have the parent name and the nodes to be
// added.we export it to integration.aml file.
for (int z = 0; z < integ.getLength(); z++) {
// to transfer node from one document to another it
// must adopt that node.
integ.item(z).getOwnerDocument().adoptNode(list.item(m));
// now we can add under the parent.
integ.item(z).appendChild(list.item(m));
}
}
}
}
}
// finally we update our integration.aml file.
Transformer xformer = TransformerFactory.newInstance().newTransformer();
xformer.transform(new DOMSource(integration),
new StreamResult(new File(ConfigManager.getFilePath() + "/integration.aml")));
// checkNodeByValue(seed, integration);
}

Frequently changed files should not be part of the commits

For example, the configuration file, should be explained in the front page of Alligator or as a part of a Wikipages here in Github.
Therefore, remove from the commits the following files:

  • config.ttl - this has to be explained as I said before.
  • resources/files/edb.txt
  • resources/files/output.txt

Static reference

The static references to the Granularity testbeds should be changed, e.g, here and here We might have many different types of heterogeneities.

Additional Information

<Name="ABC">  // attribute value matching

<WriterHeader> "abc"</WriterHeader>  // Node Value matching.

Additional Information comes under node value matching which is not yet implemented. We need to find a way that tells Additional information are semantically same or not. We do not have any refSemantic or E-class to match. In my opinion Value matching along with parent matching would be one way to solve the issue.

Execution error for some, not all, the testbeds

org.jpl7.PrologException: PrologException: error(existence_error(source_sink, 'E:/Deutch/MyPhD/HeterogeneityExampleData/AutomationML/M7/Testbeds-1/edb.pl'), _1)
    at org.jpl7.Query.get1(Query.java:308)
    at org.jpl7.Query.hasMoreSolutions(Query.java:238)
    at org.jpl7.Query.oneSolution(Query.java:659)
    at org.jpl7.Query.hasSolution(Query.java:718)
    at org.jpl7.Query.hasSolution(Query.java:740)
    at main.DeductiveDB.executeKB(DeductiveDB.java:50)
    at main.AlligatorMain.main(AlligatorMain.java:31)

If the file edb.pl exist in the folder it works but it does not generate the rules
For M1/M1.1, M2 it works but not for M1/M1.2, M4 and M7

Krextor missing Internal Element tags

Krextor is missing rules for Internal Element. I have added the rule for System Unit class however, we still need a way to add nesting of Internal Element.

<?xml version="1.0" encoding="utf-8"?>
<!--
    *  Copyright (C) 2016
    *  Ziduan Fang, Irlan Grangel-Gonzalez, Christoph Lange
    *  University of Bonn
    *
    *   Krextor is free software; you can redistribute it and/or
    *   modify it under the terms of the GNU Lesser General Public
    *   License as published by the Free Software Foundation; either
    *   version 2 of the License, or (at your option) any later version.
    *
    *   This program is distributed in the hope that it will be useful,
    *   but WITHOUT ANY WARRANTY; without even the implied warranty of
    *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    *   Lesser General Public License for more details.
    *
    *   You should have received a copy of the GNU Lesser General Public
    *   License along with this library; if not, write to the
    *   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    *   Boston, MA 02111-1307, USA.
    * 
-->

<!DOCTYPE stylesheet  [
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
<!ENTITY dc "http://purl.org/dc/elements/1.1/">
<!ENTITY aml "https://w3id.org/i40/aml/">
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
<!ENTITY schema "http://schema.org/">
]>




<xsl:transform version="2.0" 
               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
               xmlns:xd="http://www.pnp-software.com/XSLTdoc"
               xmlns:krextor="http://kwarc.info/projects/krextor"
               xmlns:krextor-genuri="http://kwarc.info/projects/krextor/genuri"
               xmlns:xs="http://www.w3.org/2001/XMLSchema"
                      exclude-result-prefixes="">

<!--  CAEXFile -->

<!--<xsl:param name="autogenerate-fragment-uris" select="'generate-id'"/>-->

 <xsl:template match="/" mode="krextor:main">
      <xsl:apply-imports>
        <xsl:with-param
          name="krextor:base-uri"
          select="xs:anyURI('https://w3id.org/i40/aml/')"
          as="xs:anyURI"
          tunnel="yes"/>
      </xsl:apply-imports>
 </xsl:template>

 <xd:doc>uses ElementN as the fragment URI of the N-th occurrence of an element named
   <code>Element</code> in document order, starting from N=1.</xd:doc>
    <xsl:function name="krextor:global-element-index" as="xs:string?">
    <xsl:param name="node" as="node()"/>
    <xsl:value-of select="concat(local-name($node), count(root($node)//*[local-name() eq local-name($node) and . &lt;&lt; $node]) + 1)"/>
    </xsl:function>

    <!-- copied and adapted from generic/uri.xsl -->
    <xsl:template match="krextor-genuri:global-element-index" as="xs:string?">
    <xsl:param name="node" as="node()"/>
    <xsl:param name="base-uri" as="xs:anyURI"/>
    <xsl:sequence select="
        resolve-uri(krextor:global-element-index($node), $base-uri)"/>
    </xsl:template>

<xsl:param name="autogenerate-fragment-uris" select="'global-element-index'" />
<!-- <xsl:param name="autogenerate-fragment-uris" select="'pseudo-xpath'" /> -->



<xsl:variable name="krextor:resources">
    <CAEXFile type="&aml;CAEXFile"/>
    <AdditionalInformation type="&aml;AdditionalInformation" related-via-properties="&aml;hasAdditionalInfomation"/>

    <ExternalReference type="&aml;ExternalReference" related-via-properties="&aml;hasExternalReference"/>

    <InstanceHierarchy type="&aml;InstanceHierarchy" related-via-properties="&aml;hasInstanceHierarchy"/>

    <InterfaceClassLib type="&aml;InterfaceClassLib" related-via-properties="&aml;hasInterfaceClassLib"/>

    <RoleClassLib type="&aml;RoleClassLib" related-via-properties="&aml;hasRoleClassLib"/>

    <SystemUnitClassLib type="&aml;SystemUnitClassLib" related-via-properties="&aml;hasSystemUnitClassLib"/>

    <InternalElement type="&aml;InternalElement" related-via-properties="&aml;hasInternalElement"/>
    <Attribute type="&aml;Attribute" related-via-properties="&aml;hasAttribute"/>
    <RefSemantic type="&aml;RefSemantic" related-via-properties="&aml;hasRefSemantic"/>
    <ExternalInterface type="&aml;ExternalInterface" related-via-properties="&aml;hasExternalInterface"/>
    <SupportedRoleClass type="&aml;SupportedRoleClass" related-via-properties="&aml;hasSupportedRoleClass"/>

    <RoleRequirements type="&aml;RoleRequirements" related-via-properties="&aml;hasRoleRequirements"/> 
    <InterfaceClass type="&aml;InterfaceClass" related-via-properties="&aml;hasInterfaceClass"/>

    <SystemUnitClass type="&aml;SystemUnitClass" related-via-properties="&aml;hasSystemUnitClass"/>

    <RoleClass type="&aml;RoleClass" related-via-properties="&aml;hasRoleClass &aml;hasRoleClass"/>
</xsl:variable>

<xsl:template match="CAEXFile
                    |CAEXFile/AdditionalInformation
                    |CAEXFile/ExternalReference
                    |CAEXFile/InstanceHierarchy
                    |CAEXFile/RoleClassLib
                    |CAEXFile/SystemUnitClassLib
                    |CAEXFile/InstanceHierarchy/InternalElement
                    |CAEXFile/InstanceHierarchy/InternalElement/InternalElement
                    |Attribute
                    |RefSemantic
                    |ExternalInterface
                    |SupportedRoleClass
                    |RoleRequirements
                    |InterfaceClassLib
                    |InterfaceClass
                    |RoleClass
                    |CAEXFile/SystemUnitClassLib/SystemUnitClass/InternalElement
                    |CAEXFile/SystemUnitClassLib/SystemUnitClass/InternalElement/InternalElement
                    |SystemUnitClass" mode="krextor:main">
       <xsl:apply-templates select="." mode="krextor:create-resource"/>
</xsl:template>


<xsl:variable name="krextor:literal-properties">
        <FileName property="&aml;hasFileName" krextor:attribute="yes"/>
        <SchemaVersion property="&aml;hasSchemaVersion" krextor:attribute="yes"/>       
<!-- AdditionalInformation -->
        <WriterName property="&aml;hasWriterName"/>
        <WriterID property="&aml;hasWriterID" datatype="&xsd;string" />
        <WriterVendor property="&aml;hasWriterVendor" datatype="&xsd;string" />
        <WriterVendorURL property="&aml;hasWriterVendorURL" datatype="&xsd;string" />
        <WriterVersion property="&aml;hasWriterVersion" datatype="&xsd;string" />
        <WriterRelease property="&aml;hasWriterRelease" datatype="&xsd;string" />
        <LastWritingDateTime property="&aml;hasLastWritingDateTime" datatype="&xsd;dateTime" />
        <WriterProjectTitle property="&aml;hasWriterProjectTitle" datatype="&xsd;string" />
        <WriterProjectID property="&aml;hasWriterProjectID" datatype="&xsd;string" />
<!-- ExternalReference -->
        <Path property="&aml;refBaseClassPath" krextor:attribute="yes" datatype="&xsd;string"/>
        <Alias property="&aml;externalReferenceAlias" krextor:attribute="yes" datatype="&xsd;string"/>  
<!-- InstanceHierarchy  -->
<!--        <Name property="&schema;name" krextor:attribute="yes" datatype="&xsd;string"/>-->

<!-- Attribute  -->
        <AttributeDataType property="&aml;hasDataType" krextor:attribute="yes" datatype="&xsd;string"/>
        <Description property="&aml;hasDescription" krextor:attribute="yes" datatype="&xsd;string"/>
        <Value property="&aml;hasAttributeValue" krextor:attribute="yes" datatype="&xsd;string"/>
        <Name property="&aml;hasAttributeName" krextor:attribute="yes" datatype="&xsd;string"/>

<!-- InternalElement -->
        <ID property="&dc;identifier" krextor:attribute="yes" datatype="&xsd;string"/>
        <RefBaseSystemUnitPath property="&aml;RefBaseSystemUnitPath" krextor:attribute="yes" datatype="&xsd;string"/>
<!-- ExternalInterface -->
        <RefBaseClassPath property="&aml;refBaseClassPath" krextor:attribute="yes" datatype="&xsd;string"/>
<!-- SupportedRoleClass -->
        <RefRoleClassPath property="&aml;refRoleClassPath" krextor:attribute="yes" datatype="&xsd;string"/>
<!-- RoleRequirements -->
        <RefBaseRoleClassPath property="&aml;refBaseRoleClassPath" krextor:attribute="yes" datatype="&xsd;string"/>
<!-- InterfaceClassLib -->
        <Version property="&aml;hasVersion" datatype="&xsd;string" />
<!-- <InterfaceClass property="&aml;hasInterfaceClass" object-is-list="true" /> -->

<!-- the following mapping rules will be simplified in the second example, this version can be treated as standard test case -->
</xsl:variable>
<xsl:template match="CAEXFile/@FileName
                      |CAEXFile/@SchemaVersion
                      |CAEXFile/AdditionalInformation/WriterHeader/WriterName
                      |CAEXFile/AdditionalInformation/WriterHeader/WriterID
                      |CAEXFile/AdditionalInformation/WriterHeader/WriterVendor
                      |CAEXFile/AdditionalInformation/WriterHeader/WriterVendorURL
                      |CAEXFile/AdditionalInformation/WriterHeader/WriterVersion
                      |CAEXFile/AdditionalInformation/WriterHeader/WriterRelease
                      |CAEXFile/AdditionalInformation/WriterHeader/LastWritingDateTime
                      |CAEXFile/AdditionalInformation/WriterHeader/WriterProjectTitle
                      |CAEXFile/AdditionalInformation/WriterHeader/WriterProjectID
                      |CAEXFile/ExternalReference/@Path
                      |CAEXFile/ExternalReference/@Alias
                      |CAEXFile/InstanceHierarchy/@Name
                      |CAEXFile/InstanceHierarchy/InternalElement/@Name
                      |CAEXFile/InstanceHierarchy/InternalElement/@ID
                      |CAEXFile/InstanceHierarchy/InternalElement/@RefBaseSystemUnitPath
                      |CAEXFile/InstanceHierarchy/InternalElement/Attribute/@Name
                      |CAEXFile/InstanceHierarchy/InternalElement/ExternalInterface/@Name
                      |CAEXFile/InstanceHierarchy/InternalElement/ExternalInterface/@ID
                      |CAEXFile/InstanceHierarchy/InternalElement/ExternalInterface/@RefBaseClassPath
                      |CAEXFile/InstanceHierarchy/InternalElement/SupportedRoleClass/@RefRoleClassPath
                      |CAEXFile/InstanceHierarchy/InternalElement/RoleRequirements/@RefBaseRoleClassPath
                      |CAEXFile/InstanceHierarchy/InternalElement/InternalElement/@Name
                      |CAEXFile/InstanceHierarchy/InternalElement/InternalElement/@ID
                      |CAEXFile/InstanceHierarchy/InternalElement/InternalElement/@RefBaseSystemUnitPath
                      |CAEXFile/InstanceHierarchy/InternalElement/InternalElement/Attribute/@Name
                      |CAEXFile/InstanceHierarchy/InternalElement/InternalElement/ExternalInterface/@Name
                      |CAEXFile/InstanceHierarchy/InternalElement/InternalElement/ExternalInterface/@ID
                      |CAEXFile/InstanceHierarchy/InternalElement/InternalElement/ExternalInterface/@RefBaseClassPath
                      |CAEXFile/InstanceHierarchy/InternalElement/InternalElement/SupportedRoleClass/@RefRoleClassPath
                      |CAEXFile/InstanceHierarchy/InternalElement/InternalElement/RoleRequirements/@RefBaseRoleClassPath
                      |CAEXFile/InterfaceClassLib/@Name
                      |CAEXFile/InterfaceClassLib/InterfaceClass/@Name
                      |CAEXFile/InterfaceClassLib/InterfaceClass/@RefBaseClassPath
                      |CAEXFile/InterfaceClassLib/InterfaceClass/Attribute/@Name
                      |CAEXFile/InterfaceClassLib/InterfaceClass/Attribute/Value
                      |CAEXFile/RoleClassLib/@Name
                      |CAEXFile/RoleClassLib/Version
                      |CAEXFile/RoleClassLib/RoleClass/@Name
                      |CAEXFile/RoleClassLib/RoleClass/Attribute/@Name
                      |CAEXFile/RoleClassLib/RoleClass/Attribute/Value
                      |CAEXFile/RoleClassLib/RoleClass/@RefBaseClassPath
                      |CAEXFile/SystemUnitClassLib/@Name
                      |CAEXFile/SystemUnitClassLib/Version
                      |CAEXFile/SystemUnitClassLib/SystemUnitClass/InternalElement/@Name
                      |CAEXFile/SystemUnitClassLib/SystemUnitClass/InternalElement/@ID
                      |CAEXFile/SystemUnitClassLib/SystemUnitClass/InternalElement/@RefBaseSystemUnitPath
                      |CAEXFile/SystemUnitClassLib/SystemUnitClass/InternalElement/Attribute/@Name
                      |CAEXFile/SystemUnitClassLib/SystemUnitClass/InternalElement/ExternalInterface/@Name
                      |CAEXFile/SystemUnitClassLib/SystemUnitClass/InternalElement/ExternalInterface/@ID
                      |CAEXFile/SystemUnitClassLib/SystemUnitClass/InternalElement/ExternalInterface/@RefBaseClassPath
                      |CAEXFile/SystemUnitClassLib/SystemUnitClass/InternalElement/SupportedRoleClass/@RefRoleClassPath
                      |CAEXFile/SystemUnitClassLib/SystemUnitClass/InternalElement/RoleRequirements/@RefBaseRoleClassPath
                      |CAEXFile/SystemUnitClassLib/SystemUnitClass/@Name
                      |CAEXFile/SystemUnitClassLib/SystemUnitClass/Attribute/@Name
                      |CAEXFile/SystemUnitClassLib/SystemUnitClass/Attribute/Value
                      |CAEXFile/SystemUnitClassLib/SystemUnitClass/ExternalInterface/@Name
                      |CAEXFile/SystemUnitClassLib/SystemUnitClass/ExternalInterface/@ID
                      |CAEXFile/SystemUnitClassLib/SystemUnitClass/ExternalInterface/@RefBaseClassPath
                      |CAEXFile/SystemUnitClassLib/SystemUnitClass/SupportedRoleClass/@RefRoleClassPath" 
                      mode="krextor:main">
 <xsl:apply-templates select="." mode="krextor:add-literal-property"/>
</xsl:template>


<xsl:template match="CAEXFile/AdditionalInformation/@AutomationMLVersion" mode="krextor:main">
  <xsl:call-template name="krextor:add-literal-property">
    <xsl:with-param name="property" select="'&aml;hasAutomationMLVersion'"/>
    <xsl:with-param name="datatype " select="'&xsd;string'"/>
  </xsl:call-template>
</xsl:template>

<xsl:template match="//RefSemantic/@CorrespondingAttributePath" mode="krextor:main">
  <xsl:call-template name="krextor:add-literal-property">
    <xsl:with-param name="property" select="'&aml;hasCorrespondingAttributePath'"/>
    <xsl:with-param name="datatype " select="'&xsd;string'"/>
  </xsl:call-template>
</xsl:template>

<xsl:template match="//Attribute/@Value" mode="krextor:main">
  <xsl:call-template name="krextor:add-literal-property">
    <xsl:with-param name="property" select="'&aml;hasAttributeValue'"/>
    <xsl:with-param name="datatype " select="'&xsd;string'"/>
  </xsl:call-template>
</xsl:template>


</xsl:transform>

Best practice to handle exceptions

We should improve the way we handle the exceptions. For example, in this method there should be specific exceptions for the file creation, etc. These exceptions should be thrown and handled in the main file.

Problems about config.ttl

I have already put the config.ttl as instructed in the main directory. However,when I run AlligatorMain.java it shows "Please especify the configuration file(config.ttl)." I was wondering if there is still anything wrong with my settings? how can I possibly solve it?

File 1, File 2 -- copying one file as it is.

File1 - E1,E2,E3,E4
File2- E5,E6,E7,E8
Output.txt (E1 E5), (E2 E7)
Integration.aml (E1,E2,E3,E4,E6)

In my opinion, one File would always come as it is even if we run this algorithm on both.

Multiple Files, still all of the files will have their data in the integration file.

Error in M1.1

If you run Alligator over M1.1/Testbed1 the result is not the same as the one that is currently in the repo. It integrates the file but with two attributes instead of one as it is in the Gold Standard.

Prolog rules match

If prolog doesnt find any match based on rules. IT generates an error and program crashes.

Pull problems

Everytime I pull I have this error.
2016-10-18_160834. I think is because a maven file is included in the commits. Please fix.

Schematic Integration.

We current don't have any way to identify if two files are schematically same.
Example 1 and Example 2 are semantically same but we dont have any rules defined to call them equivalent:

Example :1

        <InternalElement ID="acf9f51b-3fbd-4f30-891d-f8daca50ed17" Name="Connection">
            <InternalElement ID="45e20f8e-7351-4af9-bdfd-3c019674de55" Name="Conveyor1">
                <ExternalInterface ID="51e272d6-0252-4ebd-b865-2ca7a202a68e" Name="ConnectionPoint" RefBaseClassPath="BaseInterfaceClassLib@AutomationMLInterfaceClassLib/AutomationMLBaseInterface/PortConnector"/>
            </InternalElement>
            <InternalElement ID="11b59bf6-44f6-4650-939f-d8e2551912a7" Name="Conveyor2">
                <ExternalInterface ID="c50f79eb-6634-4c7e-a32f-54bdef05cace" Name="ConnectionPoint" RefBaseClassPath="BaseInterfaceClassLib@AutomationMLInterfaceClassLib/AutomationMLBaseInterface/PortConnector"/>
            </InternalElement>
            <InternalLink Name="PortLink" RefPartnerSideA="45e20f8e-7351-4af9-bdfd-3c019674de55:ConnectionPoint" RefPartnerSideB="11b59bf6-44f6-4650-939f-d8e2551912a7:ConnectionPoint"/>
        </InternalElement>

Example :2

        <InternalElement ID="45e20f8e-7351-4af9-bdfd-3c019674de55" Name="Conveyor1">
            <ExternalInterface ID="51e272d6-0252-4ebd-b865-2ca7a202a68e" Name="ConnectionPoint" RefBaseClassPath="BaseInterfaceClassLib@AutomationMLInterfaceClassLib/AutomationMLBaseInterface/PortConnector"/>
        </InternalElement>
        <InternalElement ID="11b59bf6-44f6-4650-939f-d8e2551912a7" Name="Conveyor2">
            <ExternalInterface ID="c50f79eb-6634-4c7e-a32f-54bdef05cace" Name="ConnectionPoint" RefBaseClassPath="BaseInterfaceClassLib@AutomationMLInterfaceClassLib/AutomationMLBaseInterface/PortConnector"/>
            <InternalLink Name="PortLink" RefPartnerSideA="45e20f8e-7351-4af9-bdfd-3c019674de55:ConnectionPoint" RefPartnerSideB="11b59bf6-44f6-4650-939f-d8e2551912a7:ConnectionPoint"/>
        </InternalElement>

Here both the examples represent the same connection of internal Element.
One possible solution is to identify internal Link with id.

Krextor rules for AML

For RoleClass , the rule is generating duplicated entries.

As you can see here RoleClassLib has roleClass1, roleClass1 .. should be only once.

Rules in Krextor :

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.