Package puc.tecweb.trust.layer.rdf

Examples of puc.tecweb.trust.layer.rdf.IRDFStatement


   
    if(itr.hasNext()) {
      result.append("Contextual support set:\n");
     
      while (itr.hasNext()) {
        IRDFStatement s = itr.next();
       
        result.append("\t");
        result.append(s);
        result.append("\n");
      }
    }
   
    itr = supportFacts.iterator();
     
    if(itr.hasNext()) {
      result.append("Support set:\n");
     
      while (itr.hasNext()) {
        IRDFStatement s = itr.next();
       
        result.append("\t");
        result.append(s);
        result.append("\n");
      }
View Full Code Here


      int index = 0;

      try {
        while (sentences.hasNext()) {
          IRDFStatement statement = sentences.next();

          if(statement.getSubject()!=null&&statement.getPredicate()!=null&&
              statement.getObject()!=null)
          {
            index++;
 
            if ((index % 1000) == 0)
              System.out.println(index);
           
            String subject = getNodeAsString(statement.getSubject());
 
            String predicate = getNodeAsString(statement.getPredicate());
 
            Object object = getNodeAsString(statement.getObject());
 
            String context = getNodeAsString(statement.getContext());
 
            String ID = statement.getID();
 
            goal = "fact(" + subject + ", " + predicate + ", " + object
                + ", " + context + ", " + ID + ").\n";
 
            prologFile.write(goal);
View Full Code Here

    try {
      while ((line = fr.readLine()) != null) {
        line = line.trim();
        String trustData[] = line.split(";", 4);

        IRDFStatement trustedStatement = id2statement.get(trustData[0]);

        JustificationLevel justificationLevel = new JustificationLevel(
            trustData[1], (int) Double.parseDouble(trustData[2]));

        String supportSetIDs[] = trustData[3].split(",");

        List<IRDFStatement> supportFacts = new LinkedList<IRDFStatement>();
        List<IRDFStatement> contextualSupportFacts = new LinkedList<IRDFStatement>();

        for (int i = 0; i < supportSetIDs.length; i++) {

          if (supportSetIDs[i].length() == 0)
            continue;

          IRDFStatement supportStatement =id2statement.get(supportSetIDs[i]);

          if (supportStatement.isContextual())
            contextualSupportFacts.add(supportStatement);
          else
            supportFacts.add(supportStatement);
        }
View Full Code Here

     
      return;
    }
   
    while (statementItr.hasNext()) {
      IRDFStatement statement = (IRDFStatement) statementItr.next();

      if(!id2statement.containsKey(statement.getID()))
        id2statement.put(statement.getID(), statement);
    }
  }
View Full Code Here

TOP

Related Classes of puc.tecweb.trust.layer.rdf.IRDFStatement

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.