-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
58ee8fe
commit 08e41b1
Showing
3 changed files
with
87 additions
and
5 deletions.
There are no files selected for viewing
5 changes: 3 additions & 2 deletions
5
...net-builder/modules/neo4j-export/src/test/resources/text_mining_cytests/10_concept.cypher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
MATCH | ||
(toterm:TO { | ||
iri: bkr + "to_0000233", | ||
(toterm:TO { | ||
prefName: "root volume", | ||
altName: "RTVOL", | ||
comment: "Is an indirect measure of root mass or density. Quantified in terms of cubic centimeters by water displacement method. ( Reference: GR:pj GR_REF:6917 )" | ||
}) - [ :is_a ] -> ( :TO { identifier: "TO:0000043" } ), | ||
|
||
(toterm) - [:identifier] -> (:Accession{ identifier: "TO:0000233" } ) | ||
- [:dataSource] -> ({ iri: bk + "TO" }) | ||
|
||
WHERE toterm.iri =~ bkr + "to_0000233.+" | ||
|
||
RETURN | ||
COUNT ( toterm ) = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
...builder/modules/rdf-common/src/test/java/net/sourceforge/ondex/rdf/OndexRDFUtilsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package net.sourceforge.ondex.rdf; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import org.junit.Test; | ||
|
||
/** | ||
* TODO: comment me! | ||
* | ||
* @author Marco Brandizi | ||
* <dl><dt>Date:</dt><dd>11 Mar 2024</dd></dl> | ||
* | ||
*/ | ||
public class OndexRDFUtilsTest | ||
{ | ||
private static String NS = "http://foo.com/test/"; | ||
|
||
@Test | ||
public void testIri () | ||
{ | ||
String cls = "TestConcept", acc = "A00"; | ||
int id = 1; | ||
|
||
var iri = OndexRDFUtils.iri ( NS, cls, acc, id, false ); | ||
assertEquals ( "iri() failed!", (NS + cls + "_" + acc).toLowerCase (), iri ); | ||
} | ||
|
||
@Test | ||
public void testIriForceId () | ||
{ | ||
String cls = "TestConcept", acc = "A00"; | ||
int id = 1; | ||
|
||
var iri = OndexRDFUtils.iri ( NS, cls, acc, id ); | ||
assertEquals ( "iri() failed!", (NS + cls + "_" + acc + "_" + id).toLowerCase (), iri ); | ||
} | ||
|
||
@Test | ||
public void testIriNoAcc () | ||
{ | ||
String cls = "TestConcept", acc = " "; | ||
int id = 1; | ||
|
||
var iri = OndexRDFUtils.iri ( NS, cls, acc, id ); | ||
assertEquals ( "iri() failed!", (NS + cls + "_" + id).toLowerCase (), iri ); | ||
} | ||
|
||
@Test | ||
public void testIriNoId () | ||
{ | ||
String cls = "TestConcept", acc = "A01"; | ||
|
||
var iri = OndexRDFUtils.iri ( NS, cls, acc ); | ||
assertEquals ( "iri() failed!", (NS + cls + "_" + acc).toLowerCase (), iri ); | ||
} | ||
|
||
@Test ( expected = NullPointerException.class ) | ||
public void testIriNoAccNoId () | ||
{ | ||
String cls = "TestConcept"; | ||
|
||
OndexRDFUtils.iri ( NS, cls, null ); | ||
} | ||
|
||
@Test | ||
public void testIriRepeatedClass () | ||
{ | ||
String cls = "FOO", accCode = "001", acc = "FOO:" + accCode; | ||
int id = 1; | ||
|
||
var iri = OndexRDFUtils.iri ( NS, cls, acc, id ); | ||
assertEquals ( "iri() failed!", | ||
(NS + cls + "_" + accCode + "_" + id).toLowerCase (), | ||
iri | ||
); | ||
} | ||
|
||
} |