Program: 9639
Project: 9639
Buggy source:
private List<OWLAxiom> toRDF(List<EvaluatedAxiom> evalAxioms,Class<? extends LearningAlgorithm> algorithm,Map<ConfigOption,String> parameters,SparqlEndpointKS ks,String defaultNamespace){
  if (defaultNamespace == null || defaultNamespace.isEmpty()) {
    defaultNamespace=DEFAULT_NS;
  }
  List<OWLAxiom> axioms=new ArrayList<OWLAxiom>();
  OWLDataFactory f=new OWLDataFactoryImpl();
  String suggestionSetID=defaultNamespace + generateId();
  OWLIndividual ind=f.getOWLNamedIndividual(IRI.create(suggestionSetID));
  OWLAxiom ax=f.getOWLClassAssertionAxiom(EnrichmentVocabulary.SuggestionSet,ind);
  axioms.add(ax);
  String algorithmRunID=defaultNamespace + generateId();
  OWLIndividual algorithmRunInd=f.getOWLNamedIndividual(IRI.create(algorithmRunID));
  ax=f.getOWLClassAssertionAxiom(EnrichmentVocabulary.AlgorithmRun,algorithmRunInd);
  axioms.add(ax);
  String algorithmName=algorithm.getAnnotation(ComponentAnn.class).name();
  String algorithmID="String_Node_Str" + algorithmName.replace("String_Node_Str","String_Node_Str");
  OWLIndividual algorithmInd=f.getOWLNamedIndividual(IRI.create(algorithmID));
  OWLAnnotation labelAnno=f.getOWLAnnotation(f.getOWLAnnotationProperty(OWLRDFVocabulary.RDFS_LABEL.getIRI()),f.getOWLLiteral(algorithmName));
  ax=f.getOWLAnnotationAssertionAxiom(algorithmInd.asOWLNamedIndividual().getIRI(),labelAnno);
  axioms.add(ax);
  ax=f.getOWLDataPropertyAssertionAxiom(EnrichmentVocabulary.version,algorithmInd,algorithm.getAnnotation(ComponentAnn.class).version());
  axioms.add(ax);
  ax=f.getOWLObjectPropertyAssertionAxiom(EnrichmentVocabulary.usedAlgorithm,algorithmRunInd,algorithmInd);
  axioms.add(ax);
  try {
    OWLNamedIndividual knowldegeBaseInd=f.getOWLNamedIndividual(IRI.create(ks.getEndpoint().getURL()));
    ax=f.getOWLClassAssertionAxiom(EnrichmentVocabulary.SPARQLEndpoint,knowldegeBaseInd);
    axioms.add(ax);
    ax=f.getOWLObjectPropertyAssertionAxiom(EnrichmentVocabulary.defaultGraph,knowldegeBaseInd,f.getOWLNamedIndividual(IRI.create(ks.getEndpoint().getDefaultGraphURIs().iterator().next())));
    axioms.add(ax);
    ax=f.getOWLObjectPropertyAssertionAxiom(EnrichmentVocabulary.hasInput,algorithmRunInd,knowldegeBaseInd);
    axioms.add(ax);
  }
 catch (  URISyntaxException e1) {
    e1.printStackTrace();
  }
  ax=f.getOWLObjectPropertyAssertionAxiom(EnrichmentVocabulary.creator,ind,algorithmRunInd);
  axioms.add(ax);
  Entry<OWLIndividual,List<OWLAxiom>> ind2Axioms;
  for (  EvaluatedAxiom evAx : evalAxioms) {
    ind2Axioms=evAx.toRDF(defaultNamespace).entrySet().iterator().next();
    ax=f.getOWLObjectPropertyAssertionAxiom(EnrichmentVocabulary.hasSuggestion,ind,ind2Axioms.getKey());
    axioms.add(ax);
    axioms.addAll(ind2Axioms.getValue());
  }
  return axioms;
}

Fixed version (ground truth):
private List<OWLAxiom> toRDF(List<EvaluatedAxiom> evalAxioms,Class<? extends LearningAlgorithm> algorithm,Map<ConfigOption,String> parameters,SparqlEndpointKS ks,String defaultNamespace){
  if (defaultNamespace == null || defaultNamespace.isEmpty()) {
    defaultNamespace=DEFAULT_NS;
  }
  List<OWLAxiom> axioms=new ArrayList<OWLAxiom>();
  OWLDataFactory f=new OWLDataFactoryImpl();
  String suggestionSetID=defaultNamespace + generateId();
  OWLIndividual ind=f.getOWLNamedIndividual(IRI.create(suggestionSetID));
  OWLAxiom ax=f.getOWLClassAssertionAxiom(EnrichmentVocabulary.SuggestionSet,ind);
  axioms.add(ax);
  String algorithmRunID=defaultNamespace + generateId();
  OWLIndividual algorithmRunInd=f.getOWLNamedIndividual(IRI.create(algorithmRunID));
  ax=f.getOWLClassAssertionAxiom(EnrichmentVocabulary.AlgorithmRun,algorithmRunInd);
  axioms.add(ax);
  String algorithmName=algorithm.getAnnotation(ComponentAnn.class).name();
  String algorithmID="String_Node_Str" + algorithmName.replace("String_Node_Str","String_Node_Str");
  OWLIndividual algorithmInd=f.getOWLNamedIndividual(IRI.create(algorithmID));
  OWLAnnotation labelAnno=f.getOWLAnnotation(f.getOWLAnnotationProperty(OWLRDFVocabulary.RDFS_LABEL.getIRI()),f.getOWLLiteral(algorithmName));
  ax=f.getOWLAnnotationAssertionAxiom(algorithmInd.asOWLNamedIndividual().getIRI(),labelAnno);
  axioms.add(ax);
  ax=f.getOWLDataPropertyAssertionAxiom(EnrichmentVocabulary.version,algorithmInd,algorithm.getAnnotation(ComponentAnn.class).version());
  axioms.add(ax);
  ax=f.getOWLObjectPropertyAssertionAxiom(EnrichmentVocabulary.usedAlgorithm,algorithmRunInd,algorithmInd);
  axioms.add(ax);
  OWLIndividual paramInd;
  for (  Entry<ConfigOption,String> entry : parameters.entrySet()) {
    paramInd=f.getOWLNamedIndividual(IRI.create(generateId()));
    ax=f.getOWLClassAssertionAxiom(EnrichmentVocabulary.Parameter,paramInd);
    axioms.add(ax);
    ax=f.getOWLDataPropertyAssertionAxiom(EnrichmentVocabulary.parameterName,paramInd,entry.getKey().name());
    axioms.add(ax);
    ax=f.getOWLDataPropertyAssertionAxiom(EnrichmentVocabulary.parameterValue,paramInd,entry.getValue());
    axioms.add(ax);
  }
  try {
    OWLNamedIndividual knowldegeBaseInd=f.getOWLNamedIndividual(IRI.create(ks.getEndpoint().getURL()));
    ax=f.getOWLClassAssertionAxiom(EnrichmentVocabulary.SPARQLEndpoint,knowldegeBaseInd);
    axioms.add(ax);
    ax=f.getOWLObjectPropertyAssertionAxiom(EnrichmentVocabulary.defaultGraph,knowldegeBaseInd,f.getOWLNamedIndividual(IRI.create(ks.getEndpoint().getDefaultGraphURIs().iterator().next())));
    axioms.add(ax);
    ax=f.getOWLObjectPropertyAssertionAxiom(EnrichmentVocabulary.hasInput,algorithmRunInd,knowldegeBaseInd);
    axioms.add(ax);
  }
 catch (  URISyntaxException e1) {
    e1.printStackTrace();
  }
  ax=f.getOWLObjectPropertyAssertionAxiom(EnrichmentVocabulary.creator,ind,algorithmRunInd);
  axioms.add(ax);
  Entry<OWLIndividual,List<OWLAxiom>> ind2Axioms;
  for (  EvaluatedAxiom evAx : evalAxioms) {
    ind2Axioms=evAx.toRDF(defaultNamespace).entrySet().iterator().next();
    ax=f.getOWLObjectPropertyAssertionAxiom(EnrichmentVocabulary.hasSuggestion,ind,ind2Axioms.getKey());
    axioms.add(ax);
    axioms.addAll(ind2Axioms.getValue());
  }
  return axioms;
}