예제 #1
0
 private QualifiedName getQualqualifiedName(QualifiedName qualifiedName) {
   if (qualifiedName.getNamespaceURI() == "" || qualifiedName.getNamespaceURI().equals(BNODE_NS)) {
     BNode bnode = new BNodeImpl(qualifiedName.getLocalPart());
     if (!isBNodeReferenced(bnode)) {
       return null;
     }
     return pFactory.newQualifiedName(BNODE_NS, qualifiedName.getLocalPart(), "bnode");
   }
   return qualifiedName;
 }
예제 #2
0
  private List<XMLGregorianCalendar> getInstantaneousTimes(List<Statement> statements) {
    List<XMLGregorianCalendar> times = new ArrayList<XMLGregorianCalendar>();
    for (Statement statement : statements) {
      QualifiedName predQ = convertURIToQualifiedName(statement.getPredicate());
      Value value = statement.getObject();

      if (value instanceof Literal) {
        if (predQ.equals(onto.QualifiedName_PROVO_atTime)) {
          times.add((XMLGregorianCalendar) super.decodeLiteral((Literal) value));
        }
      }
    }
    return times;
  }
예제 #3
0
 private List<QualifiedName> getSubjects(
     QualifiedName context, QualifiedName pred, QualifiedName object) {
   HashMap<QualifiedName, List<Statement>> resources = collators.get(context);
   List<QualifiedName> subjects = new ArrayList<QualifiedName>();
   for (QualifiedName subject : resources.keySet()) {
     List<Statement> statements = resources.get(subject);
     for (Statement statement : statements) {
       QualifiedName predQ = convertURIToQualifiedName(statement.getPredicate());
       Value value = statement.getObject();
       if (pred.equals(predQ) && value instanceof Resource) {
         QualifiedName valQ = convertResourceToQualifiedName((Resource) value);
         if (valQ.equals(object)) {
           subjects.add(subject);
         }
       }
     }
   }
   return subjects;
 }