コード例 #1
0
  private Map<Literal, Collection<LabeledConcept>> orderResourcesByLabel() throws OpenRDFException {
    Map<Literal, Collection<LabeledConcept>> resourcesByLabel =
        new HashMap<Literal, Collection<LabeledConcept>>();

    for (LabeledConcept labeledResource : resourceLabelsCollector.getLabeledConcepts()) {
      Literal literal = labeledResource.getLiteral();

      Collection<LabeledConcept> resourcesForLiteral = resourcesByLabel.get(literal);
      if (resourcesForLiteral == null) {
        resourcesForLiteral = new HashSet<LabeledConcept>();
        resourcesByLabel.put(literal, resourcesForLiteral);
      }

      resourcesForLiteral.add(labeledResource);
    }

    return resourcesByLabel;
  }
コード例 #2
0
 private boolean hasNonDisjointConflict(LabeledConcept resource1, LabeledConcept resource2) {
   return (resource1.getConcept() == resource2.getConcept())
       && (resource1.getLabelType() != resource2.getLabelType());
 }