Package com.franz.agbase

Examples of com.franz.agbase.Triple


  }

 
  public static void showResults(Log log, TriplesIterator it) throws AllegroGraphException {
      for (int i=0; it.hasNext(); i++) {
      Triple triple = it.next();
      log.info("Solution " + (i+1) + ": " +triple);
    }
  }
View Full Code Here


   
    out.printf("<table class=\"inline\">%n");

      for (int i=0; it.hasNext(); i++) {
        out.printf("<tr>%n");
        Triple triple = it.next();
       
        String[] objects = { triple.getSubjectLabel(), triple.getPredicateLabel(), triple.getObjectLabel() };
        for (int j = 0; j < objects.length; j++) {
          String value = objects[j];
         
        String link = Util.getLink(value);
        if ( link != null ) {
View Full Code Here

  static Model getModel(Log log, TriplesIterator it) throws AllegroGraphException {
   
    Model model = JenaUtil2.createDefaultRDFModel();
   
      while ( it.hasNext() ) {
        Triple triple = it.next();
        String objLab = triple.getObjectLabel();
       
        Resource sbj = ResourceFactory.createResource(triple.getSubjectLabel());
        Property prd = ResourceFactory.createProperty(triple.getPredicateLabel());
        RDFNode obj;
     
      if ( triple.getObject() instanceof ResourceNode ) {
        obj = ResourceFactory.createResource(objLab);
      }
      else {
        obj = ResourceFactory.createPlainLiteral(objLab);
      }
View Full Code Here

  static String getResultInNTriples(Log log, TriplesIterator it) throws AllegroGraphException {
    StringWriter sw = new StringWriter();
    PrintWriter out = new PrintWriter(sw);
   
      while ( it.hasNext() ) {
        Triple triple = it.next();
        String objLab = triple.getObjectLabel();
        ValueNode obj = triple.getObject();
        boolean objIsUri = obj instanceof ResourceNode;
     
      objLab = objIsUri ? '<' +objLab+ '>' : '"' +objLab+ '"';
       
        out.printf("<%s> <%s> %s%n", triple.getSubjectLabel(), triple.getPredicateLabel(), objLab);
      }

    return sw.toString();
  }
View Full Code Here

  static String getResultInCsv(Log log, TriplesIterator it) throws AllegroGraphException {
    StringWriter sw = new StringWriter();
    PrintWriter out = new PrintWriter(sw);
   
      for (int i=0; it.hasNext(); i++) {
        Triple triple = it.next();
        out.printf("\"%s\",\"%s\",\"%s\"%n", triple.getSubjectLabel(), triple.getPredicateLabel(), triple.getObjectLabel());
      }

    return sw.toString();
  }
View Full Code Here

TOP

Related Classes of com.franz.agbase.Triple

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.