Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions jena-db/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,19 @@
</modules>

<dependencies>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite-engine</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
Expand Down
1 change: 1 addition & 0 deletions jena-langtag/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>

<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ public class TestTextMultilingualEnhancements extends AbstractTestDatasetWithTex
"prefix text: <http://jena.apache.org/text#>",
"prefix : <" + SPEC_BASE + ">",
"",
"[] ja:loadClass \"org.apache.jena.query.text.TextQuery\" .",
"text:TextDataset rdfs:subClassOf ja:RDFDataset .",
"text:TextIndexLucene rdfs:subClassOf text:TextIndex .",

":" + SPEC_ROOT_LOCAL,
" a text:TextDataset ;",
" text:dataset :dataset ;",
Expand All @@ -84,8 +80,8 @@ public class TestTextMultilingualEnhancements extends AbstractTestDatasetWithTex
" text:directory \"mem\" ;",
" text:storeValues true ;",
" text:entityMap :entMap ;",
" text:multilingualSupport true ;",
" text:ignoreIndexErrors true ;",
" text:multilingualSupport true ;",
" text:ignoreIndexErrors true ;",
" text:defineAnalyzers (",
" [ text:defineAnalyzer :folding ;",
" text:analyzer [",
Expand All @@ -94,26 +90,26 @@ public class TestTextMultilingualEnhancements extends AbstractTestDatasetWithTex
" text:filters (text:LowerCaseFilter text:ASCIIFoldingFilter) ;",
" ]",
" ]",
" [ text:addLang \"en-01\" ;",
" text:searchFor ( \"en-01\" \"en-02\" ) ;",
" [ text:addLang \"en-001\" ;",
" text:searchFor ( \"en-001\" \"en-002\" ) ;",
" text:analyzer [ a text:StandardAnalyzer ]",
" ]",
" [ text:addLang \"en-02\" ;",
" text:searchFor ( \"en-01\" \"en-02\" ) ;",
" [ text:addLang \"en-002\" ;",
" text:searchFor ( \"en-001\" \"en-002\" ) ;",
" text:analyzer [ a text:StandardAnalyzer ]",
" ]",
" [ text:addLang \"en-03\" ;",
" [ text:addLang \"en-003\" ;",
" text:analyzer [ a text:StandardAnalyzer ]",
" ]",
" [ text:addLang \"en-04\" ;",
" [ text:addLang \"en-004\" ;",
" text:analyzer [ a text:StandardAnalyzer ]",
" ]",
" [ text:addLang \"en-05\" ;",
" text:searchFor ( \"en-05\" \"en-aux\" ) ;",
" [ text:addLang \"en-005\" ;",
" text:searchFor ( \"en-005\" \"en-aux\" ) ;",
" text:analyzer [ a text:StandardAnalyzer ]",
" ]",
" [ text:addLang \"en-aux\" ;",
" text:searchFor ( \"en-05\" \"en-aux\" ) ;",
" text:searchFor ( \"en-005\" \"en-aux\" ) ;",
" text:analyzer [ ",
" a text:DefinedAnalyzer ; ",
" text:useAnalyzer :folding",
Expand Down Expand Up @@ -192,26 +188,26 @@ public void testTextSearchFor1() {
final String turtleA = StrUtils.strjoinNL(
TURTLE_PROLOG,
"<" + RESOURCE_BASE + "testResultOneInModelA>",
" rdfs:label \"one green flower\"@en-01",
" rdfs:label \"one green flower\"@en-001",
".",
"<" + RESOURCE_BASE + "testResultTwoInModelA>",
" rdfs:label \"two green flowers\"@en-02",
" rdfs:label \"two green flowers\"@en-002",
"."
);
putTurtleInModel(turtleA, "http://example.org/modelA") ;
String queryString = StrUtils.strjoinNL(
QUERY_PROLOG,
"SELECT ?s ?lit",
"WHERE {",
" (?s ?sc ?lit ?g) text:query ( \"green\"@en-02 ) . ",
" (?s ?sc ?lit ?g) text:query ( \"green\"@en-002 ) . ",
"}"
);
Set<String> expectedURIs = new HashSet<>() ;
expectedURIs.addAll( Arrays.asList(RESOURCE_BASE + "testResultOneInModelA", RESOURCE_BASE + "testResultTwoInModelA")) ;

Map<String, Literal> literals = doTestSearchWithLiterals(queryString, expectedURIs) ;
assertEquals(2, literals.size());

Literal value = literals.get(RESOURCE_BASE + "testResultOneInModelA");
assertNotNull(value);
value = literals.get(RESOURCE_BASE + "testResultTwoInModelA");
Expand All @@ -223,26 +219,26 @@ public void testTextSearchFor2() {
final String turtleA = StrUtils.strjoinNL(
TURTLE_PROLOG,
"<" + RESOURCE_BASE + "testResultOneInModelA>",
" rdfs:label \"one green flower\"@en-01",
" rdfs:label \"one green flower\"@en-001",
".",
"<" + RESOURCE_BASE + "testResultTwoInModelA>",
" rdfs:label \"two green flowers\"@en-02",
" rdfs:label \"two green flowers\"@en-002",
"."
);
putTurtleInModel(turtleA, "http://example.org/modelA") ;
String queryString = StrUtils.strjoinNL(
QUERY_PROLOG,
"SELECT ?s ?lit",
"WHERE {",
" (?s ?sc ?lit ?g) text:query ( \"flower\"@en-01 ) . ",
" (?s ?sc ?lit ?g) text:query ( \"flower\"@en-001 ) . ",
"}"
);
Set<String> expectedURIs = new HashSet<>() ;
expectedURIs.addAll( Arrays.asList(RESOURCE_BASE + "testResultOneInModelA")) ;

Map<String, Literal> literals = doTestSearchWithLiterals(queryString, expectedURIs) ;
assertEquals(1, literals.size());

Literal value = literals.get(RESOURCE_BASE + "testResultOneInModelA");
assertNotNull(value);
}
Expand All @@ -252,26 +248,26 @@ public void testTextSimple1() {
final String turtleA = StrUtils.strjoinNL(
TURTLE_PROLOG,
"<" + RESOURCE_BASE + "testResultOneInModelA>",
" rdfs:label \"one green flower\"@en-03",
" rdfs:label \"one green flower\"@en-003",
".",
"<" + RESOURCE_BASE + "testResultTwoInModelA>",
" rdfs:label \"two green flowers\"@en-04",
" rdfs:label \"two green flowers\"@en-004",
"."
);
putTurtleInModel(turtleA, "http://example.org/modelA") ;
String queryString = StrUtils.strjoinNL(
QUERY_PROLOG,
"SELECT ?s ?lit",
"WHERE {",
" (?s ?sc ?lit ?g) text:query ( \"green\"@en-03 ) . ",
" (?s ?sc ?lit ?g) text:query ( \"green\"@en-003 ) . ",
"}"
);
Set<String> expectedURIs = new HashSet<>() ;
expectedURIs.addAll( Arrays.asList(RESOURCE_BASE + "testResultOneInModelA")) ;

Map<String, Literal> literals = doTestSearchWithLiterals(queryString, expectedURIs) ;
assertEquals(1, literals.size());

Literal value = literals.get(RESOURCE_BASE + "testResultOneInModelA");
assertNotNull(value);
}
Expand All @@ -281,10 +277,10 @@ public void testTextAux1() {
final String turtleA = StrUtils.strjoinNL(
TURTLE_PROLOG,
"<" + RESOURCE_BASE + "testResultOneInModelA>",
" rdfs:label \"one Green flower\"@en-05",
" rdfs:label \"one Green flower\"@en-005",
".",
"<" + RESOURCE_BASE + "testResultTwoInModelA>",
" rdfs:label \"two gReeN flowers\"@en-05",
" rdfs:label \"two gReeN flowers\"@en-005",
"."
);
putTurtleInModel(turtleA, "http://example.org/modelA") ;
Expand All @@ -297,10 +293,10 @@ public void testTextAux1() {
);
Set<String> expectedURIs = new HashSet<>() ;
expectedURIs.addAll( Arrays.asList(RESOURCE_BASE + "testResultOneInModelA", RESOURCE_BASE + "testResultTwoInModelA")) ;

Map<String, Literal> literals = doTestSearchWithLiterals(queryString, expectedURIs) ;
assertEquals(2, literals.size());

Literal value = literals.get(RESOURCE_BASE + "testResultOneInModelA");
assertNotNull(value);
value = literals.get(RESOURCE_BASE + "testResultTwoInModelA");
Expand Down