-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Language specification support - load only values with correct langua…
…ge tag in Owlapi driver, part I.
- Loading branch information
Showing
9 changed files
with
215 additions
and
73 deletions.
There are no files selected for viewing
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
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
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
39 changes: 39 additions & 0 deletions
39
ontodriver-owlapi/src/test/java/cz/cvut/kbss/ontodriver/owlapi/util/OwlapiUtilsTest.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,39 @@ | ||
package cz.cvut.kbss.ontodriver.owlapi.util; | ||
|
||
import org.junit.Test; | ||
import org.semanticweb.owlapi.model.OWLDataFactory; | ||
import org.semanticweb.owlapi.model.OWLLiteral; | ||
import uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
public class OwlapiUtilsTest { | ||
|
||
private static final String LANG = "en"; | ||
|
||
private OWLDataFactory dataFactory = new OWLDataFactoryImpl(); | ||
|
||
@Test | ||
public void doesLanguageMatchReturnsTrueWhenLanguageTagMatches() { | ||
final OWLLiteral literal = dataFactory.getOWLLiteral("test", LANG); | ||
assertTrue(OwlapiUtils.doesLanguageMatch(literal, LANG)); | ||
} | ||
|
||
@Test | ||
public void doesLanguageMatchReturnsFalseWhenLanguageTagDoesNotMatch() { | ||
final OWLLiteral literal = dataFactory.getOWLLiteral("test", LANG); | ||
assertFalse(OwlapiUtils.doesLanguageMatch(literal, "cs")); | ||
} | ||
|
||
@Test | ||
public void doesLanguageMatchReturnsTrueWhenLanguageIsNotSpecified() { | ||
final OWLLiteral literal = dataFactory.getOWLLiteral("test", LANG); | ||
assertTrue(OwlapiUtils.doesLanguageMatch(literal, null)); | ||
} | ||
|
||
@Test | ||
public void doesLanguageMatchReturnsTrueWhenLiteralHasNoLanguageTag() { | ||
final OWLLiteral literal = dataFactory.getOWLLiteral("test"); | ||
assertTrue(OwlapiUtils.doesLanguageMatch(literal, LANG)); | ||
} | ||
} |
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
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
Oops, something went wrong.