-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add limit to wikidata consumer, change query to consider subclass, ad…
…d test for all classes
- Loading branch information
Showing
40 changed files
with
810 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
/dist/ | ||
/build/ | ||
/store/ | ||
build | ||
|
||
|
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-3.88 KB
build/classes/type/detect/kb/knowledgegraph/KnowledgeGraphUtil.class
Binary file not shown.
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,7 +1,8 @@ | ||
PREFIX entity: <http://www.wikidata.org/entity/> | ||
SELECT ?typelabel | ||
SELECT distinct ?typelabel | ||
WHERE | ||
{ | ||
entity:{{id}} wdt:P31 ?type . | ||
entity:{{id}} wdt:P31|wdt:P279 ?type . | ||
?type rdfs:label ?typelabel FILTER (LANG(?typelabel)="en") . | ||
} | ||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
* 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 type.detect; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Set; | ||
import junit.framework.TestCase; | ||
|
||
/** | ||
* | ||
* @author Amir | ||
*/ | ||
public class TypeDetectTest extends TestCase { | ||
|
||
public TypeDetectTest(String testName) { | ||
super(testName); | ||
} | ||
|
||
@Override | ||
protected void setUp() throws Exception { | ||
super.setUp(); | ||
} | ||
|
||
@Override | ||
protected void tearDown() throws Exception { | ||
super.tearDown(); | ||
} | ||
|
||
/** | ||
* Test of main method, of class TypeDetect. | ||
*/ | ||
public void testMain() { | ||
System.out.println("main"); | ||
String[] args = null; | ||
TypeDetect.main(args); | ||
// TODO review the generated test code and remove the default call to fail. | ||
fail("The test case is a prototype."); | ||
} | ||
|
||
/** | ||
* Test of besttype method, of class TypeDetect. | ||
*/ | ||
public void testBesttype_String() { | ||
System.out.println("besttype"); | ||
String text = ""; | ||
TypeDetect instance = new TypeDetect(); | ||
String expResult = ""; | ||
String result = instance.besttype(text); | ||
assertEquals(expResult, result); | ||
// TODO review the generated test code and remove the default call to fail. | ||
fail("The test case is a prototype."); | ||
} | ||
|
||
/** | ||
* Test of besttype method, of class TypeDetect. | ||
*/ | ||
public void testBesttype_List() { | ||
System.out.println("besttype"); | ||
List<String> list = Arrays.asList("ITGB3", "ERBB2", "CTLA4"); | ||
TypeDetect instance = new TypeDetect(); | ||
String result = instance.besttype(list); | ||
assertEquals("protein-coding gene", result); | ||
} | ||
|
||
public void testBesttype_List2() { | ||
System.out.println("besttype"); | ||
List<String> list = Arrays.asList("Klebsiella", "Escherichia coli", "Bacteria and protozoa", "Neisseria meningitidis"); | ||
TypeDetect instance = new TypeDetect(); | ||
String result = instance.besttype(list); | ||
assertEquals("taxon", result); | ||
// System.out.println(result); | ||
} | ||
|
||
/** | ||
* Test of besttype method, of class TypeDetect. | ||
*/ | ||
public void testBesttype_Set() { | ||
System.out.println("besttype"); | ||
Set<String> set = null; | ||
TypeDetect instance = new TypeDetect(); | ||
String expResult = ""; | ||
String result = instance.besttype(set); | ||
assertEquals(expResult, result); | ||
// TODO review the generated test code and remove the default call to fail. | ||
fail("The test case is a prototype."); | ||
} | ||
|
||
} |
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,45 @@ | ||
/* | ||
* 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 type.detect.kb; | ||
|
||
import junit.framework.Test; | ||
import junit.framework.TestCase; | ||
import junit.framework.TestSuite; | ||
import type.detect.kb.freebase.FreebaseSuite; | ||
import type.detect.kb.knowledgegraph.KnowledgegraphSuite; | ||
import type.detect.kb.sparql.SparqlSuite; | ||
import type.detect.kb.wikidata.WikidataSuite; | ||
|
||
/** | ||
* | ||
* @author Amir | ||
*/ | ||
public class KbSuite extends TestCase { | ||
|
||
public KbSuite(String testName) { | ||
super(testName); | ||
} | ||
|
||
public static Test suite() { | ||
TestSuite suite = new TestSuite("KbSuite"); | ||
suite.addTest(WikidataSuite.suite()); | ||
suite.addTest(KnowledgegraphSuite.suite()); | ||
suite.addTest(SparqlSuite.suite()); | ||
suite.addTest(FreebaseSuite.suite()); | ||
return suite; | ||
} | ||
|
||
@Override | ||
protected void setUp() throws Exception { | ||
super.setUp(); | ||
} | ||
|
||
@Override | ||
protected void tearDown() throws Exception { | ||
super.tearDown(); | ||
} | ||
|
||
} |
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,38 @@ | ||
/* | ||
* 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 type.detect.kb.freebase; | ||
|
||
import junit.framework.Test; | ||
import junit.framework.TestCase; | ||
import junit.framework.TestSuite; | ||
|
||
/** | ||
* | ||
* @author Amir | ||
*/ | ||
public class FreebaseSuite extends TestCase { | ||
|
||
public FreebaseSuite(String testName) { | ||
super(testName); | ||
} | ||
|
||
public static Test suite() { | ||
TestSuite suite = new TestSuite("FreebaseSuite"); | ||
suite.addTest(FreebaseUtilTest.suite()); | ||
return suite; | ||
} | ||
|
||
@Override | ||
protected void setUp() throws Exception { | ||
super.setUp(); | ||
} | ||
|
||
@Override | ||
protected void tearDown() throws Exception { | ||
super.tearDown(); | ||
} | ||
|
||
} |
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,79 @@ | ||
/* | ||
* 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 type.detect.kb.freebase; | ||
|
||
import java.util.Map; | ||
import junit.framework.Test; | ||
import junit.framework.TestCase; | ||
import junit.framework.TestSuite; | ||
import net.sf.json.JSONArray; | ||
|
||
/** | ||
* | ||
* @author Amir | ||
*/ | ||
public class FreebaseUtilTest extends TestCase { | ||
|
||
public FreebaseUtilTest(String testName) { | ||
super(testName); | ||
} | ||
|
||
public static Test suite() { | ||
TestSuite suite = new TestSuite(FreebaseUtilTest.class); | ||
return suite; | ||
} | ||
|
||
@Override | ||
protected void setUp() throws Exception { | ||
super.setUp(); | ||
} | ||
|
||
@Override | ||
protected void tearDown() throws Exception { | ||
super.tearDown(); | ||
} | ||
|
||
/** | ||
* Test of main method, of class FreebaseUtil. | ||
*/ | ||
public void testMain() { | ||
System.out.println("main"); | ||
String[] args = null; | ||
FreebaseUtil.main(args); | ||
// TODO review the generated test code and remove the default call to fail. | ||
fail("The test case is a prototype."); | ||
} | ||
|
||
/** | ||
* Test of search method, of class FreebaseUtil. | ||
*/ | ||
public void testSearch() { | ||
System.out.println("search"); | ||
String query = ""; | ||
String mql_query_file = ""; | ||
int limit = 0; | ||
JSONArray expResult = null; | ||
JSONArray result = FreebaseUtil.search(query, mql_query_file, limit); | ||
assertEquals(expResult, result); | ||
// TODO review the generated test code and remove the default call to fail. | ||
fail("The test case is a prototype."); | ||
} | ||
|
||
/** | ||
* Test of fetch method, of class FreebaseUtil. | ||
*/ | ||
public void testFetch() { | ||
System.out.println("fetch"); | ||
String query_template_file = ""; | ||
Map<String, String> params = null; | ||
JSONArray expResult = null; | ||
JSONArray result = FreebaseUtil.fetch(query_template_file, params); | ||
assertEquals(expResult, result); | ||
// TODO review the generated test code and remove the default call to fail. | ||
fail("The test case is a prototype."); | ||
} | ||
|
||
} |
Oops, something went wrong.