Mentions légales du service

Skip to content
Snippets Groups Projects
Commit e5ed74a2 authored by Nicolas Guillouet's avatar Nicolas Guillouet
Browse files

New Version with Linkkeys : parsing and rendering with RDF

parent b37253af
No related branches found
No related tags found
No related merge requests found
Showing
with 803 additions and 537 deletions
...@@ -752,5 +752,31 @@ ...@@ -752,5 +752,31 @@
</edoal:transformation> </edoal:transformation>
</Cell> </Cell>
</map> </map>
<!-- test on linkkeys -->
<map>
<Cell rdf:about="LinkkeyTest">
<entity1>
<edoal:Class rdf:about="&wine;VintageYear" />
</entity1>
<entity2>
<edoal:Class rdf:about="&vin;Millesime" />
</entity2>
<measure rdf:datatype='&xsd;float'>1.</measure>
<edoal:linkkey>
<Linkkey edoal:type="weak">
<binding>
<Corresp edoal:type="eq">
<property1>
<edoal:Property rdf:about="&wine;yearValue" />
</property1>
<property2>
<edoal:Property rdf:about="&vin;annee_millesime" />
</property2>
</Corresp>
</binding>
</Linkkey>
</edoal:linkkey>
</Cell>
</map>
</Alignment> </Alignment>
</rdf:RDF> </rdf:RDF>
No preview for this file type
...@@ -17,13 +17,13 @@ ...@@ -17,13 +17,13 @@
<groupId>org.semanticweb.owl</groupId> <groupId>org.semanticweb.owl</groupId>
<artifactId>align</artifactId> <artifactId>align</artifactId>
<version>4.6</version> <version>4.6</version>
<!-- Rev 1874M 22/01/2014 --> <!-- Rev 1954M 10/07/2014 -->
<name>The Alignment API</name> <name>The Alignment API</name>
<description>The Alignment API is an API for manipulating ontology alignments.</description> <description>The Alignment API is an API for manipulating ontology alignments.</description>
<url>http://alignapi.gforge.inria.fr</url> <url>http://alignapi.gforge.inria.fr</url>
<organization> <organization>
<name>INRIA Exmo team</name> <name>INRIA Exmo team</name>
<url>http://exmo.inrialpes.fr</url> <url>http://exmo.inria.fr</url>
</organization> </organization>
<!-- (C) INRIA, 2003-2014 --> <!-- (C) INRIA, 2003-2014 -->
<licenses> <licenses>
......
No preview for this file type
...@@ -17,13 +17,13 @@ ...@@ -17,13 +17,13 @@
<groupId>fr.inrialpes.exmo.align</groupId> <groupId>fr.inrialpes.exmo.align</groupId>
<artifactId>alignsvc</artifactId> <artifactId>alignsvc</artifactId>
<version>4.6</version> <version>4.6</version>
<!-- Rev 1874M 22/01/2014 --> <!-- Rev 1954M 10/07/2014 -->
<name>Alignment server</name> <name>Alignment server</name>
<description>A server for storing and sharing ontology alignments.</description> <description>A server for storing and sharing ontology alignments.</description>
<url>http://alignapi.gforge.inria.fr</url> <url>http://alignapi.gforge.inria.fr</url>
<organization> <organization>
<name>INRIA Exmo team</name> <name>INRIA Exmo team</name>
<url>http://exmo.inrialpes.fr</url> <url>http://exmo.inria.fr</url>
</organization> </organization>
<!-- (C) INRIA, 2003-2014 --> <!-- (C) INRIA, 2003-2014 -->
<licenses> <licenses>
......
No preview for this file type
...@@ -17,13 +17,13 @@ ...@@ -17,13 +17,13 @@
<groupId>fr.inrialpes.exmo</groupId> <groupId>fr.inrialpes.exmo</groupId>
<artifactId>ontowrap</artifactId> <artifactId>ontowrap</artifactId>
<version>4.6</version> <version>4.6</version>
<!-- Rev 1874M 22/01/2014 --> <!-- Rev 1954M 10/07/2014 -->
<name>Ontology wrapping API</name> <name>Ontology wrapping API</name>
<description>An ontology wrapping API and library.</description> <description>An ontology wrapping API and library.</description>
<url>http://alignapi.gforge.inria.fr</url> <url>http://alignapi.gforge.inria.fr</url>
<organization> <organization>
<name>INRIA Exmo team</name> <name>INRIA Exmo team</name>
<url>http://exmo.inrialpes.fr</url> <url>http://exmo.inria.fr</url>
</organization> </organization>
<!-- (C) INRIA, 2003-2014 --> <!-- (C) INRIA, 2003-2014 -->
<licenses> <licenses>
......
No preview for this file type
...@@ -17,13 +17,13 @@ ...@@ -17,13 +17,13 @@
<groupId>fr.inrialpes.exmo.align</groupId> <groupId>fr.inrialpes.exmo.align</groupId>
<artifactId>procalign</artifactId> <artifactId>procalign</artifactId>
<version>4.6</version> <version>4.6</version>
<!-- Rev 1874M 22/01/2014 --> <!-- Rev 1954M 10/07/2014 -->
<name>Reference implementation of the Alignment API</name> <name>Reference implementation of the Alignment API</name>
<description>Implementation of the Alignment API for manipulating ontology alignments.</description> <description>Implementation of the Alignment API for manipulating ontology alignments.</description>
<url>http://alignapi.gforge.inria.fr</url> <url>http://alignapi.gforge.inria.fr</url>
<organization> <organization>
<name>INRIA Exmo team</name> <name>INRIA Exmo team</name>
<url>http://exmo.inrialpes.fr</url> <url>http://exmo.inria.fr</url>
</organization> </organization>
<!-- (C) INRIA, 2003-2014 --> <!-- (C) INRIA, 2003-2014 -->
<licenses> <licenses>
......
...@@ -22,9 +22,6 @@ ...@@ -22,9 +22,6 @@
package fr.inrialpes.exmo.align.impl.edoal; package fr.inrialpes.exmo.align.impl.edoal;
import org.semanticweb.owl.align.AlignmentException;
import org.semanticweb.owl.align.AlignmentVisitor;
/** /**
* <p> * <p>
* Superclass for all ClassRestrictions. * Superclass for all ClassRestrictions.
......
...@@ -22,15 +22,8 @@ ...@@ -22,15 +22,8 @@
package fr.inrialpes.exmo.align.impl.edoal; package fr.inrialpes.exmo.align.impl.edoal;
import java.io.PrintStream;
import java.io.IOException;
import java.util.Comparator;
import java.util.Set; import java.util.Set;
import java.util.HashSet; import java.util.HashSet;
import java.lang.ClassNotFoundException;
import java.lang.Float;
import java.lang.Double;
import java.net.URISyntaxException;
import java.net.URI; import java.net.URI;
import org.semanticweb.owl.align.Alignment; import org.semanticweb.owl.align.Alignment;
...@@ -40,7 +33,6 @@ import org.semanticweb.owl.align.Cell; ...@@ -40,7 +33,6 @@ import org.semanticweb.owl.align.Cell;
import org.semanticweb.owl.align.Relation; import org.semanticweb.owl.align.Relation;
import fr.inrialpes.exmo.align.impl.BasicCell; import fr.inrialpes.exmo.align.impl.BasicCell;
import fr.inrialpes.exmo.align.impl.rel.*;
import fr.inrialpes.exmo.align.parser.TypeCheckingVisitor; import fr.inrialpes.exmo.align.parser.TypeCheckingVisitor;
...@@ -72,6 +64,7 @@ public class EDOALCell extends BasicCell { ...@@ -72,6 +64,7 @@ public class EDOALCell extends BasicCell {
private URI id; // This is the id private URI id; // This is the id
private Set<Transformation> transformations; private Set<Transformation> transformations;
private Set<Linkkey> linkkeys;
public void accept( AlignmentVisitor visitor) throws AlignmentException { public void accept( AlignmentVisitor visitor) throws AlignmentException {
visitor.visit( this ); visitor.visit( this );
...@@ -110,6 +103,16 @@ public class EDOALCell extends BasicCell { ...@@ -110,6 +103,16 @@ public class EDOALCell extends BasicCell {
public Set<Transformation> transformations() { public Set<Transformation> transformations() {
return transformations; return transformations;
} }
public void addLinkkey( Linkkey linkkey ){
if ( linkkeys == null ) {
linkkeys = new HashSet<Linkkey>();
}
linkkeys.add( linkkey );
}
public Set<Linkkey> linkkeys() {
return linkkeys;
}
public Cell inverse() throws AlignmentException { public Cell inverse() throws AlignmentException {
EDOALCell invcell = new EDOALCell( (String)null, (Expression)object2, (Expression)object1, relation.inverse(), strength ); EDOALCell invcell = new EDOALCell( (String)null, (Expression)object2, (Expression)object1, relation.inverse(), strength );
......
...@@ -45,6 +45,8 @@ public interface EDOALVisitor { ...@@ -45,6 +45,8 @@ public interface EDOALVisitor {
public void visit( Value o ) throws AlignmentException; public void visit( Value o ) throws AlignmentException;
public void visit( Apply o ) throws AlignmentException; public void visit( Apply o ) throws AlignmentException;
public void visit( Datatype o ) throws AlignmentException; public void visit( Datatype o ) throws AlignmentException;
public void visit( Linkkey o ) throws AlignmentException;
public void visit( LinkkeyBinding o ) throws AlignmentException;
//public void visit( Comparator o ) throws AlignmentException; //public void visit( Comparator o ) throws AlignmentException;
//public void visit( EDOALCell o ) throws AlignmentException; //public void visit( EDOALCell o ) throws AlignmentException;
} }
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package fr.inrialpes.exmo.align.impl.edoal;
import fr.inrialpes.exmo.align.parser.TypeCheckingVisitor;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.semanticweb.owl.align.AlignmentException;
/**
*
* @author Nicolas Guillouet <nicolas@meaningengines.com>
*/
public class Linkkey {
public static final String PLAIN = "plain";
public static final String WEAK = "weak";
public static final String STRONG = "strong";
private static List<String> ALLOWED_TYPES = Arrays.asList(PLAIN, WEAK, STRONG);
private String type;
private Set<LinkkeyBinding> bindings;
public void accept(EDOALVisitor visitor) throws AlignmentException {
visitor.visit(this);
}
public TypeCheckingVisitor.TYPE accept( TypeCheckingVisitor visitor ) throws AlignmentException {
return visitor.visit(this);
}
public Linkkey() throws AlignmentException {
this(PLAIN);
}
public Linkkey(String type) throws AlignmentException {
if(!ALLOWED_TYPES.contains(type)){
throw new AlignmentException("The type " + type + " is not allowed !");
}
this.type = type;
bindings = new HashSet<>();
}
public void addBinding(LinkkeyBinding binding){
bindings.add(binding);
}
public Set<LinkkeyBinding> bindings(){
return bindings;
}
public String getType() {
return type;
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package fr.inrialpes.exmo.align.impl.edoal;
import fr.inrialpes.exmo.align.parser.TypeCheckingVisitor;
import java.util.Arrays;
import java.util.List;
import org.semanticweb.owl.align.AlignmentException;
import org.semanticweb.owl.align.AlignmentVisitor;
import org.semanticweb.owl.align.Visitable;
/**
*
* @author Nicolas Guillouet <nicolas@meaningengines.com>
*/
public class LinkkeyBinding {
public static final String IN = "in";
public static final String EQ = "eq";
private static List<String> ALLOWED_TYPES = Arrays.asList(IN, EQ);
private PathExpression expression1;
private PathExpression expression2;
private String type;
public LinkkeyBinding(PathExpression expression1, PathExpression expression2, String type) throws AlignmentException {
if(!ALLOWED_TYPES.contains(type)){
throw new AlignmentException("The type " + type + " is not allowed !");
}
this.type = type;
this.expression1 = expression1;
this.expression2 = expression2;
}
public void accept(EDOALVisitor visitor) throws AlignmentException {
visitor.visit(this);
}
public TypeCheckingVisitor.TYPE accept( TypeCheckingVisitor visitor ) throws AlignmentException {
return visitor.visit(this);
}
public String getType(){
return type;
}
public PathExpression getExpression1(){
return expression1;
}
public PathExpression getExpression2(){
return expression2;
}
}
...@@ -22,9 +22,6 @@ ...@@ -22,9 +22,6 @@
package fr.inrialpes.exmo.align.impl.edoal; package fr.inrialpes.exmo.align.impl.edoal;
import java.util.Collection;
import java.util.Set;
/** /**
* <p> * <p>
* Represents a PropertyExpression. * Represents a PropertyExpression.
......
...@@ -78,6 +78,8 @@ import fr.inrialpes.exmo.align.impl.edoal.Datatype; ...@@ -78,6 +78,8 @@ import fr.inrialpes.exmo.align.impl.edoal.Datatype;
import fr.inrialpes.exmo.align.impl.edoal.Comparator; import fr.inrialpes.exmo.align.impl.edoal.Comparator;
import fr.inrialpes.exmo.align.impl.edoal.EDOALCell; import fr.inrialpes.exmo.align.impl.edoal.EDOALCell;
import fr.inrialpes.exmo.align.impl.edoal.EDOALVisitor; import fr.inrialpes.exmo.align.impl.edoal.EDOALVisitor;
import fr.inrialpes.exmo.align.impl.edoal.Linkkey;
import fr.inrialpes.exmo.align.impl.edoal.LinkkeyBinding;
/** /**
* Renders an alignment in JSON (and in fact in JSON-LD) * Renders an alignment in JSON (and in fact in JSON-LD)
...@@ -646,5 +648,13 @@ public class JSONRendererVisitor extends IndentedRendererVisitor implements Alig ...@@ -646,5 +648,13 @@ public class JSONRendererVisitor extends IndentedRendererVisitor implements Alig
decreaseIndent(); decreaseIndent();
decreaseIndent(); decreaseIndent();
} }
public void visit(final Linkkey linkkey) throws AlignmentException {
throw new AlignmentException("NOT IMPLEMENTED !");
}
public void visit(final LinkkeyBinding linkkeyBinding) throws AlignmentException {
throw new AlignmentException("NOT IMPLEMENTED !");
}
} }
...@@ -81,6 +81,8 @@ import fr.inrialpes.exmo.align.impl.edoal.Comparator; ...@@ -81,6 +81,8 @@ import fr.inrialpes.exmo.align.impl.edoal.Comparator;
import fr.inrialpes.exmo.align.impl.edoal.EDOALCell; import fr.inrialpes.exmo.align.impl.edoal.EDOALCell;
import fr.inrialpes.exmo.align.impl.edoal.EDOALAlignment; import fr.inrialpes.exmo.align.impl.edoal.EDOALAlignment;
import fr.inrialpes.exmo.align.impl.edoal.EDOALVisitor; import fr.inrialpes.exmo.align.impl.edoal.EDOALVisitor;
import fr.inrialpes.exmo.align.impl.edoal.Linkkey;
import fr.inrialpes.exmo.align.impl.edoal.LinkkeyBinding;
/** /**
* Renders an alignment as a new ontology merging these. * Renders an alignment as a new ontology merging these.
...@@ -846,4 +848,11 @@ public class OWLAxiomsRendererVisitor extends IndentedRendererVisitor implements ...@@ -846,4 +848,11 @@ public class OWLAxiomsRendererVisitor extends IndentedRendererVisitor implements
indentedOutput("<owl:Datatype><owl:onDataType rdf:resource=\""+e.getType()+"\"/></owl:Datatype>"); indentedOutput("<owl:Datatype><owl:onDataType rdf:resource=\""+e.getType()+"\"/></owl:Datatype>");
} }
public void visit(final Linkkey linkkey) throws AlignmentException {
throw new AlignmentException("NOT IMPLEMENTED !");
}
public void visit(final LinkkeyBinding linkkeyBinding) throws AlignmentException {
throw new AlignmentException("NOT IMPLEMENTED !");
}
} }
...@@ -33,6 +33,8 @@ import fr.inrialpes.exmo.ontowrap.Ontology; ...@@ -33,6 +33,8 @@ import fr.inrialpes.exmo.ontowrap.Ontology;
import fr.inrialpes.exmo.align.impl.Namespace; import fr.inrialpes.exmo.align.impl.Namespace;
import fr.inrialpes.exmo.align.impl.BasicAlignment; import fr.inrialpes.exmo.align.impl.BasicAlignment;
import fr.inrialpes.exmo.align.impl.edoal.Expression; import fr.inrialpes.exmo.align.impl.edoal.Expression;
import fr.inrialpes.exmo.align.impl.edoal.Linkkey;
import fr.inrialpes.exmo.align.impl.edoal.LinkkeyBinding;
import java.net.URI; import java.net.URI;
import java.util.Enumeration; import java.util.Enumeration;
...@@ -252,5 +254,12 @@ public class SILKRendererVisitor extends GraphPatternRendererVisitor implements ...@@ -252,5 +254,12 @@ public class SILKRendererVisitor extends GraphPatternRendererVisitor implements
// default behaviour // default behaviour
// rel.write( writer ); // rel.write( writer );
} }
public void visit(final Linkkey linkkey) throws AlignmentException {
throw new AlignmentException("NOT IMPLEMENTED !");
}
public void visit(final LinkkeyBinding linkkeyBinding) throws AlignmentException {
throw new AlignmentException("NOT IMPLEMENTED !");
}
} }
...@@ -28,6 +28,8 @@ import org.semanticweb.owl.align.Relation; ...@@ -28,6 +28,8 @@ import org.semanticweb.owl.align.Relation;
import fr.inrialpes.exmo.align.impl.BasicAlignment; import fr.inrialpes.exmo.align.impl.BasicAlignment;
import fr.inrialpes.exmo.align.impl.edoal.EDOALAlignment; import fr.inrialpes.exmo.align.impl.edoal.EDOALAlignment;
import fr.inrialpes.exmo.align.impl.edoal.Expression; import fr.inrialpes.exmo.align.impl.edoal.Expression;
import fr.inrialpes.exmo.align.impl.edoal.Linkkey;
import fr.inrialpes.exmo.align.impl.edoal.LinkkeyBinding;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.net.URI; import java.net.URI;
...@@ -142,6 +144,13 @@ public class SPARQLConstructRendererVisitor extends GraphPatternRendererVisitor ...@@ -142,6 +144,13 @@ public class SPARQLConstructRendererVisitor extends GraphPatternRendererVisitor
// default behaviour // default behaviour
// rel.write( writer ); // rel.write( writer );
} }
public void visit(final Linkkey linkkey) throws AlignmentException {
throw new AlignmentException("NOT IMPLEMENTED !");
}
public void visit(final LinkkeyBinding linkkeyBinding) throws AlignmentException {
throw new AlignmentException("NOT IMPLEMENTED !");
}
protected void generateConstruct(Cell cell, Expression expr1, Expression expr2) throws AlignmentException { protected void generateConstruct(Cell cell, Expression expr1, Expression expr2) throws AlignmentException {
// Here the generation is dependent on global variables // Here the generation is dependent on global variables
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment