Changeset 544
- Timestamp:
- 08/05/12 02:17:56 (10 months ago)
- Location:
- trunk/ontoCAT/src/uk/ac/ebi/ontocat/examples
- Files:
-
- 3 edited
-
Example1.java (modified) (1 diff)
-
Example2.java (modified) (1 diff)
-
Example3.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ontoCAT/src/uk/ac/ebi/ontocat/examples/Example1.java
r483 r544 45 45 } 46 46 47 // Find all terms containing string thymus 48 for (OntologyTerm ot : os.searchAll("thymus", SearchOptions.EXACT, 47 // Find all terms containing string adipocyte 48 // NB: OLS does not support searching properties in searchAll(), use 49 // searchOntology() instead 50 for (OntologyTerm ot : os.searchAll("adipocyte", 49 51 SearchOptions.INCLUDE_PROPERTIES)) { 50 52 System.out.println(ot); -
trunk/ontoCAT/src/uk/ac/ebi/ontocat/examples/Example2.java
r483 r544 49 49 } 50 50 51 // Find all terms containing string thymus52 for (OntologyTerm ot : os.searchAll(" thymus", SearchOptions.EXACT,51 // Find all terms containing string adipocyte 52 for (OntologyTerm ot : os.searchAll("adipocyte", 53 53 SearchOptions.INCLUDE_PROPERTIES)) { 54 54 System.out.println(ot); -
trunk/ontoCAT/src/uk/ac/ebi/ontocat/examples/Example3.java
r483 r544 25 25 import java.net.URISyntaxException; 26 26 27 import uk.ac.ebi.ontocat.OntologyService.SearchOptions; 27 28 import uk.ac.ebi.ontocat.OntologyServiceException; 28 29 import uk.ac.ebi.ontocat.OntologyTerm; … … 36 37 */ 37 38 public class Example3 { 38 public static void main(String[] args) throws OntologyServiceException, URISyntaxException { 39 public static void main(String[] args) throws OntologyServiceException, 40 URISyntaxException { 39 41 // Instantiate a FileOntologyService 40 FileOntologyService os = new FileOntologyService(new URI("http://www.ebi.ac.uk/efo"), "EFO"); 41 // Use a non-SKOS annotation for synonyms 42 os.setSynonymSlot("alternative_term"); 42 FileOntologyService os = new FileOntologyService(new URI( 43 "http://www.ebi.ac.uk/efo"), "EFO"); 43 44 44 // Find all terms containing string thymus 45 for (OntologyTerm ot : os.searchAll("thymus")) { 45 // Find all terms containing string adipocyte 46 for (OntologyTerm ot : os.searchAll("adipocyte", 47 SearchOptions.INCLUDE_PROPERTIES)) { 46 48 System.out.println(ot); 47 49 }
Note: See TracChangeset
for help on using the changeset viewer.