connectionUtils/src/main/java/com/ge/research/semtk/sparqlX/SparqlToXUtils.java
public static boolean checkURIType(String uri, String type, String sparqlServerUrl, String sparqlDataset, String serverTypeString, String user, String pass) throws Exception{
    String checkTypeQuery = "select * where { " +  
        "VALUES ?x {<" + uri + ">} . " +
        "?x rdf:type <" + type + ">" +
        "}";
    // execute query
    SparqlEndpointInterface endpoint = SparqlEndpointInterface.executeQuery(sparqlServerUrl, sparqlDataset, serverTypeString, checkTypeQuery, user, pass, SparqlResultTypes.TABLE);
    String[] results = endpoint.getStringResultsColumn("x");
    
    if(results != null && results.length > 0){
      return true; 
    }
    return false;
  }
/**
   * Check to see if a URI is of a given type.  True if matches, false if does not
   * @throws Exception 
   */
Check to see if a URI is of a given type.  True if matches, false if does not
@throws Exception
Check to see if a URI is of a given type . True if matches false if does not @throws Exception
public static boolean checkURIType(String uri, String type, String sparqlServerUrl, String sparqlDataset, String serverTypeString, String user, String pass) throws Exception{
    String checkTypeQuery = "select * where { " +  
        "VALUES ?x {<" + uri + ">} . " +
        "?x rdf:type <" + type + ">" +
        "}";
    SparqlEndpointInterface endpoint = SparqlEndpointInterface.executeQuery(sparqlServerUrl, sparqlDataset, serverTypeString, checkTypeQuery, user, pass, SparqlResultTypes.TABLE);
    String[] results = endpoint.getStringResultsColumn("x");
    if(results != null && results.length > 0){
      return true; 
    }
    return false;
  }
public static boolean checkURIType ( String uri , String type , String sparqlServerUrl , String sparqlDataset , String serverTypeString , String user , String pass ) throws Exception { String checkTypeQuery = "select * where { " + "VALUES ?x {<" + uri + ">} . " + "?x rdf:type <" + type + ">" + "}" ; SparqlEndpointInterface endpoint = SparqlEndpointInterface . executeQuery ( sparqlServerUrl , sparqlDataset , serverTypeString , checkTypeQuery , user , pass , SparqlResultTypes . TABLE ) ; String [ ] results = endpoint . getStringResultsColumn ( "x" ) ; if ( results != null && results . length > 0 ) { return true ; } return false ; }
Check to see if a URI is of a given type.
Check to see if a URI is of a given type .
// execute query