connectionUtils/src/main/java/com/ge/research/semtk/sparqlX/SparqlToXUtils.java
public static String generateDeleteURISubjectQuery(SparqlEndpointInterface sei, String uri, String predicate) throws IOException {
   
    // avoid catastrophic delete by checking that URI does not start with ?  
    if(uri.startsWith("?")){
      LocalLogger.logToStdOut("URI to delete may not start with '?'...not deleting");
      throw new IOException("URI to delete may not start with '?'");
    }else if(uri.trim().equals("")){
      LocalLogger.logToStdOut("URI to delete may not be empty...not deleting");
      throw new IOException("URI to delete may not be empty");
    }
    
    // predicate must be null or a valid string - if it's empty then something is wrong
    if(predicate != null && predicate.trim().equals("")){
      LocalLogger.logToStdOut("Predicate to delete may not be empty...not deleting");
      throw new IOException("Predicate to delete may not be empty");
    }
    
    if(predicate == null){
      predicate = "?y1";  // no predicate specified - do not restrict it
    }else{
      predicate = "<" + predicate + ">";  // predicate specified - use it
    }
    
    String query = generateWithDeleteWhereClause(sei, "") + " <" +  uri + "> " + predicate + " ?z1 . } ";  // uri is subject
    return query;
  }
/**
   * Generate a DELETE query where the subject is a specific URI, and the predicate is given.
   * Expects that predicate will NOT be enclosed by < >
   * @throws IOException
   */
Generate a DELETE query where the subject is a specific URI, and the predicate is given.
Expects that predicate will NOT be enclosed by < >
@throws IOException
Generate a DELETE query where the subject is a specific URI and the predicate is given . Expects that predicate will NOT be enclosed by < > @throws IOException
public static String generateDeleteURISubjectQuery(SparqlEndpointInterface sei, String uri, String predicate) throws IOException {
    if(uri.startsWith("?")){
      LocalLogger.logToStdOut("URI to delete may not start with '?'...not deleting");
      throw new IOException("URI to delete may not start with '?'");
    }else if(uri.trim().equals("")){
      LocalLogger.logToStdOut("URI to delete may not be empty...not deleting");
      throw new IOException("URI to delete may not be empty");
    }
    if(predicate != null && predicate.trim().equals("")){
      LocalLogger.logToStdOut("Predicate to delete may not be empty...not deleting");
      throw new IOException("Predicate to delete may not be empty");
    }
    if(predicate == null){
      predicate = "?y1";  
    }else{
      predicate = "<" + predicate + ">";  
    }
    String query = generateWithDeleteWhereClause(sei, "") + " <" +  uri + "> " + predicate + " ?z1 . } ";  
    return query;
  }
public static String generateDeleteURISubjectQuery ( SparqlEndpointInterface sei , String uri , String predicate ) throws IOException { if ( uri . startsWith ( "?" ) ) { LocalLogger . logToStdOut ( "URI to delete may not start with '?'...not deleting" ) ; throw new IOException ( "URI to delete may not start with '?'" ) ; } else if ( uri . trim ( ) . equals ( "" ) ) { LocalLogger . logToStdOut ( "URI to delete may not be empty...not deleting" ) ; throw new IOException ( "URI to delete may not be empty" ) ; } if ( predicate != null && predicate . trim ( ) . equals ( "" ) ) { LocalLogger . logToStdOut ( "Predicate to delete may not be empty...not deleting" ) ; throw new IOException ( "Predicate to delete may not be empty" ) ; } if ( predicate == null ) { predicate = "?y1" ; } else { predicate = "<" + predicate + ">" ; } String query = generateWithDeleteWhereClause ( sei , "" ) + " <" + uri + "> " + predicate + " ?z1 . } " ; return query ; }
Generate a DELETE query where the subject is a specific URI, and the predicate is given.
Generate a DELETE query where the subject is a specific URI and the predicate is given .
// avoid catastrophic delete by checking that URI does not start with ?   // predicate must be null or a valid string - if it's empty then something is wrong // no predicate specified - do not restrict it // predicate specified - use it // uri is subject