Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Alignment API
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
GitLab upgrade completed. Current version is 17.11.3.
Show more breadcrumbs
moex
Alignment API
Commits
af6efcd2
Commit
af6efcd2
authored
16 years ago
by
Jérôme Euzenat
Browse files
Options
Downloads
Patches
Plain Diff
- moved copyright lines
- added new tests
parent
0cffe68c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/src/BasicAlignmentTest.java
+1
-1
1 addition, 1 deletion
test/src/BasicAlignmentTest.java
test/src/MatcherTest.java
+105
-0
105 additions, 0 deletions
test/src/MatcherTest.java
test/src/READMETest.java
+1
-1
1 addition, 1 deletion
test/src/READMETest.java
with
107 additions
and
2 deletions
test/src/BasicAlignmentTest.java
+
1
−
1
View file @
af6efcd2
/*
* $Id$
*
* Copyright (C) INRIA
Rhne-Alpes,
2008
* Copyright (C) INRIA, 2008
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
...
...
This diff is collapsed.
Click to expand it.
test/src/MatcherTest.java
0 → 100644
+
105
−
0
View file @
af6efcd2
/*
* $Id$
*
* Copyright (C) INRIA, 2008
*
* This program 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.1 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 program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
//package test.com.acme.dona.dep;
import
static
org
.
testng
.
Assert
.
assertEquals
;
import
static
org
.
testng
.
Assert
.
assertNotNull
;
import
static
org
.
testng
.
Assert
.
assertNull
;
import
static
org
.
testng
.
Assert
.
assertTrue
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Configuration
;
import
org.testng.annotations.Test
;
//import org.testng.annotations.*;
import
org.semanticweb.owl.align.AlignmentVisitor
;
import
org.semanticweb.owl.align.AlignmentException
;
import
org.semanticweb.owl.align.AlignmentProcess
;
import
org.semanticweb.owl.align.Alignment
;
import
org.semanticweb.owl.align.Parameters
;
import
org.semanticweb.owl.align.Evaluator
;
import
fr.inrialpes.exmo.align.impl.renderer.RDFRendererVisitor
;
import
fr.inrialpes.exmo.align.impl.method.StringDistAlignment
;
import
fr.inrialpes.exmo.align.impl.eval.PRecEvaluator
;
import
fr.inrialpes.exmo.align.impl.BasicParameters
;
import
fr.inrialpes.exmo.align.impl.URIAlignment
;
import
fr.inrialpes.exmo.align.onto.OntologyCache
;
import
fr.inrialpes.exmo.align.parser.AlignmentParser
;
import
fr.inrialpes.exmo.align.util.NullStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.PrintWriter
;
import
java.io.BufferedWriter
;
import
java.io.OutputStreamWriter
;
import
java.io.FileOutputStream
;
import
java.io.OutputStream
;
import
java.net.URI
;
import
java.net.URISyntaxException
;
/**
* These tests corresponds to the README file in the main directory
*/
public
class
MatcherTest
{
private
AlignmentProcess
alignment
=
null
;
// Add one test with instances in the ontology (the same ontology)
@Test
(
groups
=
{
"full"
,
"impl"
})
public
void
routineTest8
()
throws
Exception
{
/*
$ java -jar lib/Procalign.jar file://$CWD/examples/rdf/edu.umbc.ebiquity.publication.owl file://$CWD/examples/rdf/edu.mit.visus.bibtex.owl -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=levenshteinDistance -o examples/rdf/bibref.rdf
*/
Parameters
params
=
new
BasicParameters
();
params
.
setParameter
(
"stringFunction"
,
"levenshteinDistance"
);
params
.
setParameter
(
"noinst"
,
"1"
);
alignment
=
new
StringDistAlignment
();
assertNotNull
(
alignment
,
"ObjectAlignment should not be null"
);
assertEquals
(
alignment
.
nbCells
(),
0
);
alignment
.
init
(
new
URI
(
"file:examples/rdf/edu.umbc.ebiquity.publication.owl"
),
new
URI
(
"file:examples/rdf/edu.mit.visus.bibtex.owl"
));
alignment
.
align
(
(
Alignment
)
null
,
params
);
assertEquals
(
alignment
.
nbCells
(),
43
);
FileOutputStream
stream
=
new
FileOutputStream
(
"test/output/bibref.rdf"
);
PrintWriter
writer
=
new
PrintWriter
(
new
BufferedWriter
(
new
OutputStreamWriter
(
stream
,
"UTF-8"
)),
true
);
AlignmentVisitor
renderer
=
new
RDFRendererVisitor
(
writer
);
alignment
.
render
(
renderer
);
writer
.
flush
();
writer
.
close
();
//assertEquals( stream.toString().length(), 1740, "Rendered differently" );
/*
$ java -jar lib/Procalign.jar file://$CWD/examples/rdf/edu.umbc.ebiquity.publication.owl file://$CWD/examples/rdf/edu.mit.visus.bibtex.owl -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=subStringDistance -t .4 -o examples/rdf/bibref2.rdf
*/
alignment
.
cut
(
"hard"
,
0.55
);
assertEquals
(
alignment
.
nbCells
(),
32
);
/* With .4, I have either 36 or 35! */
stream
=
new
FileOutputStream
(
"test/output/bibref2.rdf"
);
writer
=
new
PrintWriter
(
new
BufferedWriter
(
new
OutputStreamWriter
(
stream
,
"UTF-8"
)),
true
);
alignment
.
render
(
new
RDFRendererVisitor
(
writer
)
);
writer
.
flush
();
writer
.
close
();
//assertEquals( stream.toString().length(), 1740, "Rendered differently" );
}
}
This diff is collapsed.
Click to expand it.
test/src/READMETest.java
+
1
−
1
View file @
af6efcd2
/*
* $Id$
*
* Copyright (C) INRIA
Rhne-Alpes,
2008
* Copyright (C) INRIA, 2008
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment