--- a/src/main/java/net/timbusproject/dpes/alternative/kb/PackageUniverseBuilder.java
+++ b/src/main/java/net/timbusproject/dpes/alternative/kb/PackageUniverseBuilder.java
@@ -24,12 +24,14 @@
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.ArrayList;
-import java.util.LinkedList;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
-import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
+import java.util.TreeSet;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
@@ -45,20 +47,31 @@
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
+import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DurationFormatUtils;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.io.FileDocumentTarget;
import org.semanticweb.owlapi.io.OWLXMLOntologyFormat;
+import org.semanticweb.owlapi.io.RDFXMLOntologyFormat;
import org.semanticweb.owlapi.model.AddImport;
import org.semanticweb.owlapi.model.IRI;
+import org.semanticweb.owlapi.model.OWLClass;
+import org.semanticweb.owlapi.model.OWLClassExpression;
import org.semanticweb.owlapi.model.OWLDataFactory;
+import org.semanticweb.owlapi.model.OWLDataProperty;
import org.semanticweb.owlapi.model.OWLNamedIndividual;
import org.semanticweb.owlapi.model.OWLObjectProperty;
+import org.semanticweb.owlapi.model.OWLOntologyCreationException;
+import org.semanticweb.owlapi.model.OWLOntologyFormat;
import org.semanticweb.owlapi.model.OWLOntologyID;
import org.semanticweb.owlapi.model.OWLOntologyManager;
import org.semanticweb.owlapi.model.OWLOntologyStorageException;
+import uk.ac.manchester.cs.owl.owlapi.OWLObjectHasValueImpl;
+import uk.ac.manchester.cs.owl.owlapi.OWLObjectIntersectionOfImpl;
+import uk.ac.manchester.cs.owl.owlapi.OWLObjectUnionOfImpl;
import uk.ac.manchester.cs.owl.owlapi.OWLOntologyImpl;
/**
@@ -66,6 +79,15 @@
*/
public class PackageUniverseBuilder {
+ public static final String IRIPREFIX_PACKAGE_UNIVERSE = "http://timbus.teco.edu/ontologies/preservationIdentifier/PackageUniverse";
+
+ public static final IRI IRI_CUDF_VERSIONEDPACKAGE = IRI.create(VirtualPackageAlternativeIdentifier.IRI_CUDF.toString()
+ + "#VersionedPackage");
+
+ public static final OWLClass CLASS_CUDF_VERSIONEDPACKAGE = OWLManager.getOWLDataFactory().getOWLClass(
+ IRI_CUDF_VERSIONEDPACKAGE);
+
+ // Object Properties
public static final OWLObjectProperty OBJECTPROPERTY_CUDF_DEPENDS = OWLManager.getOWLDataFactory().getOWLObjectProperty(
IRI.create(VirtualPackageAlternativeIdentifier.IRI_CUDF.toString() + "#", "hasDependency"));
@@ -75,6 +97,19 @@
public static final OWLObjectProperty OBJECTPROPERTY_CUDF_RECOMMENDS = OWLManager.getOWLDataFactory().getOWLObjectProperty(
IRI.create(VirtualPackageAlternativeIdentifier.IRI_CUDF.toString() + "#", "hasRecommendation"));
+ public static final OWLObjectProperty OBJECTROPERTY_REALIZED_BY = OWLManager.getOWLDataFactory().getOWLObjectProperty(
+ IRI.create(VirtualPackageAlternativeIdentifier.IRI_CUDF.toString() + "#", "realizedBy"));
+
+ // Data Properties
+ public static final OWLDataProperty DATAPROPERTY_HAS_VERSION = OWLManager.getOWLDataFactory().getOWLDataProperty(
+ IRI.create(VirtualPackageAlternativeIdentifier.IRI_CUDF.toString() + "#", "hasVersion"));
+
+ public static final OWLDataProperty DATAPROPERTY_HAS_NAME = OWLManager.getOWLDataFactory().getOWLDataProperty(
+ IRI.create(VirtualPackageAlternativeIdentifier.IRI_CUDF.toString() + "#", "hasName"));
+
+ public static final OWLDataProperty DATAPROPERTY_HAS_COMPARATOR = OWLManager.getOWLDataFactory().getOWLDataProperty(
+ IRI.create(VirtualPackageAlternativeIdentifier.IRI_CUDF.toString() + "#", "hasComparator"));
+
public static final String aptitudeSearchCommand = "aptitude search -F %p \".*\"";
static final Logger logUniverse = Logger.getLogger("PackaUniverseBuilder");
@@ -86,8 +121,10 @@
Options options = new Options();
options.addOption(new Option("l", "loadPackages", true, "Load package information from a serialised file"));
- options.addOption(new Option("x", "loadPackagesXML", true, "Load package information from an XML serialised file"));
- options.addOption(new Option("j", "loadPackagesJSON", true, "Load package information from a JSON serialised file"));
+ options.addOption(new Option("x", "loadPackagesXML", true,
+ "Load package information from an XML serialised file"));
+ options.addOption(new Option("j", "loadPackagesJSON", true,
+ "Load package information from a JSON serialised file"));
CommandLineParser parser = new BasicParser();
try {
@@ -121,51 +158,13 @@
long startTime = System.currentTimeMillis();
- // search all packages
- ArrayList<String> allPackageNames = VirtualPackageAlternativeIdentifier.searchPackages(aptitudeSearchCommand);
- logUniverse.info("Found " + allPackageNames.size() + " packages.\n");
-
- if (allPackages == null) {
- allPackages = new TreeMap<String, Package>();
- // allPackages = new HashMap<String, Package>(allPackageNames.size());
- }
-
- // read missing packages
-
- // query the package information, in parallel manner
- int nrOfProcessors = Runtime.getRuntime().availableProcessors();
- ExecutorService eservice = Executors.newFixedThreadPool(nrOfProcessors);
- logUniverse.info("*** Working with " + nrOfProcessors + " parallel processes");
-
- List<Future<Package>> futuresList = new ArrayList<Future<Package>>();
-
- int maxTestCount = 50;
- int index = 0;
- for (String packageName : allPackageNames) {
- index++;
- // check if we need to query this package
- if (allPackages.containsKey(packageName)) {
- // logUniverse.info("Not querying already loaded package " + packageName);
- } else {
- futuresList.add(eservice.submit(new PackgeDetailsTask(packageName)));
- }
- // if (index == maxTestCount) {
- // break;
- // }
- }
-
- // wait for all tasks to finish
- eservice.shutdown();
- try {
- eservice.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
- } catch (InterruptedException e) {
- System.out.println(e);
- }
+ List<Future<Package>> futuresList = queryNotLoadedPackages(allPackages);
// store the results - if there were any
if (futuresList.size() > 0) {
long endReadingPackagesTime = System.currentTimeMillis();
- logUniverse.info("Reading packages took " + DurationFormatUtils.formatDurationHMS(endReadingPackagesTime - startTime));
+ logUniverse.info("Reading packages took "
+ + DurationFormatUtils.formatDurationHMS(endReadingPackagesTime - startTime));
for (Future<Package> future : futuresList) {
Package pkg;
@@ -184,12 +183,14 @@
// object serialisation
logUniverse.info("Wrote packages to "
- + SerialisationUtils.writeAsBinary(allPackages, VirtualPackageAlternativeIdentifier.PATH_KNOWDLEDGE_BASE + fileName).getAbsolutePath());
+ + SerialisationUtils.writeAsBinary(allPackages,
+ VirtualPackageAlternativeIdentifier.PATH_KNOWDLEDGE_BASE + fileName).getAbsolutePath());
// save packages as JSON
try {
logUniverse.info("Wrote packages to "
- + SerialisationUtils.writeAsJSON(allPackages, VirtualPackageAlternativeIdentifier.PATH_KNOWDLEDGE_BASE, fileName, true).getAbsolutePath());
+ + SerialisationUtils.writeAsJSON(allPackages,
+ VirtualPackageAlternativeIdentifier.PATH_KNOWDLEDGE_BASE, fileName, true).getAbsolutePath());
} catch (FileNotFoundException e1) {
e1.printStackTrace();
}
@@ -197,7 +198,8 @@
// save packages in XML
try {
logUniverse.info("Wrote packages to "
- + SerialisationUtils.writeAsXML(allPackages, VirtualPackageAlternativeIdentifier.PATH_KNOWDLEDGE_BASE, fileName, true).getAbsolutePath());
+ + SerialisationUtils.writeAsXML(allPackages,
+ VirtualPackageAlternativeIdentifier.PATH_KNOWDLEDGE_BASE, fileName, true).getAbsolutePath());
} catch (FileNotFoundException e1) {
e1.printStackTrace();
}
@@ -239,23 +241,24 @@
}
}
- logUniverse.info("Parsed all packages");
-
- // do post-processing ==> after all packages are read, we can resolve the links
- for (Package pkg : allPackages.values()) {
- pkg.resolveLinks(allPackages);
- }
-
- logUniverse.info("Resolved links between packages");
+ logUniverse.info("Pre-parsed all packages");
+
final String ontologyPrefix = "packageUniverse-" + OSIdentifier.getEscapedOSString();
OWLOntologyImpl ontology = convertToOWL(allPackages, ontologyPrefix);
logUniverse.info("Converted to OWL");
File file = new File(VirtualPackageAlternativeIdentifier.PATH_KNOWDLEDGE_BASE + ontologyPrefix + ".owl");
+ if (!file.getParentFile().exists()) {
+ file.getParentFile().mkdirs();
+ logUniverse.info("Created directory " + file.getParentFile().getAbsolutePath());
+ }
+
FileDocumentTarget fileDocumentTarget = new FileDocumentTarget(file);
try {
- OWLManager.createOWLOntologyManager().saveOntology(ontology, new OWLXMLOntologyFormat(), fileDocumentTarget);
+ OWLOntologyFormat format = new RDFXMLOntologyFormat();
+ format = new OWLXMLOntologyFormat();
+ OWLManager.createOWLOntologyManager().saveOntology(ontology, format, fileDocumentTarget);
logUniverse.info("Saved to " + file.getAbsolutePath());
} catch (OWLOntologyStorageException e) {
e.printStackTrace();
@@ -264,6 +267,54 @@
long totalEndTime = System.currentTimeMillis();
logUniverse.info("Total duration: " + DurationFormatUtils.formatDurationHMS(totalEndTime - startTime));
+
+ logUniverse.info("Trying to load ontology again from " + file.getAbsolutePath());
+ try {
+ OWLManager.createOWLOntologyManager().loadOntologyFromOntologyDocument(file);
+ logUniverse.info("... Success");
+ } catch (OWLOntologyCreationException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ public static List<Future<Package>> queryNotLoadedPackages(SortedMap<String, Package> allPackages) {
+ // search all packages
+ ArrayList<String> allPackageNames = VirtualPackageAlternativeIdentifier.searchPackages(aptitudeSearchCommand);
+ logUniverse.info("Found " + allPackageNames.size() + " packages.\n");
+
+ // read missing packages
+
+ // query the package information, in parallel manner
+ int nrOfProcessors = Runtime.getRuntime().availableProcessors();
+ ExecutorService eservice = Executors.newFixedThreadPool(nrOfProcessors);
+ logUniverse.info("*** Working with " + nrOfProcessors + " parallel processes");
+
+ List<Future<Package>> futuresList = new ArrayList<Future<Package>>();
+
+ int maxTestCount = 50;
+ int index = 0;
+ for (String packageName : allPackageNames) {
+ index++;
+ // check if we need to query this package
+ if (allPackages.containsKey(packageName)) {
+ // logUniverse.info("Not querying already loaded package " + packageName);
+ } else {
+ futuresList.add(eservice.submit(new PackgeDetailsTask(packageName)));
+ }
+ // if (index == maxTestCount) {
+ // break;
+ // }
+ }
+
+ // wait for all tasks to finish
+ eservice.shutdown();
+ try {
+ eservice.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
+ } catch (InterruptedException e) {
+ System.out.println(e);
+ }
+ return futuresList;
}
public static OWLOntologyImpl convertToOWL(SortedMap<String, Package> allPackages, String ontologyPrefix) {
@@ -271,38 +322,187 @@
OWLDataFactory df = OWLManager.getOWLDataFactory();
OWLOntologyManager manager = OWLManager.createOWLOntologyManager(df);
- IRI ontologyIRI = IRI.create(VirtualPackageAlternativeIdentifier.IRIPREFIX_KB_PACKAGE_ALTERNATIVES + ontologyPrefix + ".owl");
+ IRI ontologyIRI = IRI.create(IRIPREFIX_PACKAGE_UNIVERSE + ontologyPrefix + ".owl");
OWLOntologyImpl ontology = new OWLOntologyImpl(manager, new OWLOntologyID(ontologyIRI));
- manager.applyChange(new AddImport(ontology, df.getOWLImportsDeclaration(VirtualPackageAlternativeIdentifier.IRI_CUDF)));
-
- final Set<Entry<String, Package>> entrySet = allPackages.entrySet();
- for (Entry<String, Package> entry : entrySet) {
- // 1. create the package
+ manager.applyChange(new AddImport(ontology,
+ df.getOWLImportsDeclaration(VirtualPackageAlternativeIdentifier.IRI_CUDF)));
+
+ // 1. create the packages
+ HashMap<Package, OWLNamedIndividual> indivMap = new HashMap<Package, OWLNamedIndividual>();
+ for (Entry<String, Package> entry : allPackages.entrySet()) {
// 1. I.) individual creation & create class assertion (CUDF#Package)
- OWLNamedIndividual packageIndiv = OWLUtils.createAndRegisterIndividual(ontologyIRI.toString(), entry.getKey(),
+ OWLNamedIndividual packageIndiv = OWLUtils.createAndRegisterIndividual(ontologyIRI.toString(),
+ entry.getKey(), VirtualPackageAlternativeIdentifier.CLASS_CUDF_PACKAGE, df, manager, ontology);
+ Package pkg = entry.getValue();
+ indivMap.put(pkg, packageIndiv);
+ OWLUtils.addDataProperty(packageIndiv, ontology, df, manager, DATAPROPERTY_HAS_VERSION, pkg.getName());
+ if (StringUtils.isNotBlank(pkg.getVersionString())) {
+ OWLUtils.addDataProperty(packageIndiv, ontology, df, manager, DATAPROPERTY_HAS_VERSION,
+ pkg.getVersionString());
+ }
+ }
+
+ final TreeSet<String> treeSet = new TreeSet<String>(allPackages.keySet());
+ try {
+ FileUtils.writeLines(new File("/tmp/allPackages.txt"), treeSet);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ for (Entry<Package, OWLNamedIndividual> entry : indivMap.entrySet()) {
+ OWLNamedIndividual packageIndiv = entry.getValue();
+
+ // createRelations(df, manager, ontologyIRI, ontology, packageIndiv, entry.getKey().getDepends(),
+ // OBJECTPROPERTY_CUDF_DEPENDS);
+ // createRelations(df, manager, ontologyIRI, ontology, packageIndiv, entry.getKey().getConflicts(),
+ // OBJECTPROPERTY_CUDF_CONFLICTS);
+ // createRelations(df, manager, ontologyIRI, ontology, packageIndiv, entry.getKey().getRecommends(),
+ // OBJECTPROPERTY_CUDF_RECOMMENDS);
+ //
+ // // do post-processing ==> after all packages are read, we can resolve the links
+ // for (Package pkg : allPackages.values()) {
+ // pkg.resolveLinks(allPackages);
+ // }
+
+ parseDependencyPackages(packageIndiv, entry.getKey(), entry.getKey().getDependsString(), allPackages,
+ indivMap, df, manager, ontologyIRI, ontology, OBJECTPROPERTY_CUDF_DEPENDS);
+ }
+ logUniverse.info("Resolved links between packages");
+ return ontology;
+ }
+
+ public static void parseDependencyPackages(OWLNamedIndividual packageIndiv, Package pkg, String pkgListString,
+ Map<String, Package> packageNameMap, HashMap<Package, OWLNamedIndividual> indivMap, OWLDataFactory df,
+ OWLOntologyManager manager, IRI ontologyIRI, OWLOntologyImpl ontology, OWLObjectProperty property) {
+
+ ArrayList<OWLClassExpression> simpleAndDependencies = new ArrayList<OWLClassExpression>();
+
+ if (pkgListString != null) {
+ final String[] allReferences = pkgListString.split(",");
+ for (String referenceStr : allReferences) {
+ referenceStr = referenceStr.trim();
+
+ if (referenceStr.contains("|")) {
+ // parse each individual reference, combine them to union afterwards
+ HashSet<OWLClassExpression> orDependencies = new HashSet<OWLClassExpression>();
+ for (String reference : referenceStr.split("\\|")) {
+ reference = reference.trim();
+ OWLObjectHasValueImpl objectHasValueExpression = parseReference(packageIndiv, pkg, indivMap,
+ packageNameMap, df, manager, ontologyIRI, ontology, property, reference);
+
+ if (objectHasValueExpression == null) {
+ System.out.println("Did not find a reference for " + reference);
+ }
+ orDependencies.add(objectHasValueExpression);
+ }
+ // assemble union, add to other dependencies (TODO: or not? add it directly as simple union?)
+ OWLObjectUnionOfImpl union = new OWLObjectUnionOfImpl(orDependencies);
+ simpleAndDependencies.add(union);
+ // System.out.println("\t\tIgnoring package: " + parsedPackageInfo.getName() + "; ref was: " + packageRef);
+ } else {
+ OWLObjectHasValueImpl objectHasValueExpression = parseReference(packageIndiv, pkg, indivMap,
+ packageNameMap, df, manager, ontologyIRI, ontology, property, referenceStr);
+ simpleAndDependencies.add(objectHasValueExpression);
+ }
+
+ }
+ }
+
+ if (simpleAndDependencies.size() == 1) {
+ OWLUtils.assertClass(packageIndiv, simpleAndDependencies.get(0), ontology, df, manager);
+ } else if (simpleAndDependencies.size() > 1) {
+ OWLObjectIntersectionOfImpl intersection = new OWLObjectIntersectionOfImpl(new HashSet<OWLClassExpression>(
+ simpleAndDependencies));
+ OWLUtils.assertClass(packageIndiv, intersection, ontology, df, manager);
+ }
+
+ }
+
+ private static OWLObjectHasValueImpl parseReference(OWLNamedIndividual packageIndiv, Package pkg,
+ HashMap<Package, OWLNamedIndividual> indivMap, Map<String, Package> packageNameMap, OWLDataFactory df,
+ OWLOntologyManager manager, IRI ontologyIRI, OWLOntologyImpl ontology, OWLObjectProperty property,
+ String referenceStr) {
+ String targetPackageName;
+ String comparator = null;
+ String targetVersion = null;
+
+ // OWLNamedIndividual targetIndiv = getOrCreateTargetIndiv(packageNameMap, indivMap, df, manager,
+ // ontologyIRI, ontology, targetPackageName);
+ // OWLUtils.createRelation(packageIndiv, targetIndiv, ontology, df, manager, property);
+ boolean isReferenceWithVersion = referenceStr.contains("(") && referenceStr.contains(")");
+
+ if (!isReferenceWithVersion) { // simple package
+ targetPackageName = referenceStr.trim();
+ } else { // assume a versioned package relation
+ targetPackageName = referenceStr.substring(0, referenceStr.indexOf("(")).trim();
+ // parse info on referenced package
+ String[] referenceStrParts = referenceStr.split("\\(");
+
+ String pkgRelation = referenceStrParts[1].trim();
+ if (!pkgRelation.endsWith(")")) {
+ System.out.println("The package relation string details doesn't end with ) for " + pkgRelation);
+ return null;
+ }
+ pkgRelation = pkgRelation.substring(0, pkgRelation.length() - 1);
+ String[] pkgVersionDetailParts = pkgRelation.split(" ");
+ comparator = pkgVersionDetailParts[0].trim();
+ targetVersion = pkgVersionDetailParts[1].trim();
+ }
+
+ String versionedPackageName = pkg.getName() + targetPackageName;
+ // create reference individual, aka "VersionedPackage"
+ OWLNamedIndividual virtualPackageIndiv = OWLUtils.createAndRegisterIndividual(ontologyIRI.toString(),
+ versionedPackageName, CLASS_CUDF_VERSIONEDPACKAGE, df, manager, ontology);
+ if (StringUtils.isNotBlank(targetVersion)) {
+ OWLUtils.addDataProperty(virtualPackageIndiv, ontology, df, manager, DATAPROPERTY_HAS_VERSION,
+ targetVersion);
+ }
+ if (StringUtils.isNotBlank(comparator)) {
+ OWLUtils.addDataProperty(virtualPackageIndiv, ontology, df, manager, DATAPROPERTY_HAS_COMPARATOR,
+ comparator);
+ }
+ OWLUtils.addDataProperty(virtualPackageIndiv, ontology, df, manager, DATAPROPERTY_HAS_NAME, targetPackageName);
+
+ // relate this package with reference individual (VersionedPackage)
+ OWLUtils.createRelation(packageIndiv, virtualPackageIndiv, ontology, df, manager, property);
+
+ // relate create reference individual (VersionedPackage) with target indiv
+ OWLNamedIndividual targetPackage = getOrCreateTargetIndiv(packageNameMap, indivMap, df, manager, ontologyIRI,
+ ontology, targetPackageName);
+ OWLUtils.createRelation(virtualPackageIndiv, targetPackage, ontology, df, manager, OBJECTROPERTY_REALIZED_BY);
+
+ // add the owl value assertion, to be assembled later
+ OWLObjectHasValueImpl objectHasValueExpression = new OWLObjectHasValueImpl(OBJECTPROPERTY_CUDF_DEPENDS,
+ virtualPackageIndiv);
+ return objectHasValueExpression;
+ }
+
+ public static OWLNamedIndividual getOrCreateTargetIndiv(Map<String, Package> packageNameMap,
+ HashMap<Package, OWLNamedIndividual> indivMap, OWLDataFactory df, OWLOntologyManager manager,
+ IRI ontologyIRI, OWLOntologyImpl ontology, String targetPackageName) {
+ Package targetPackage = packageNameMap.get(targetPackageName);
+ OWLNamedIndividual targetIndiv = indivMap.get(targetPackage);
+ if (targetPackage == null) {
+ String targetPackageNamei386 = targetPackageName + ":i386";
+ boolean hasi386 = packageNameMap.containsKey(targetPackageNamei386);
+ System.out.println("No target package found for '" + targetPackageName + "'; found as "
+ + targetPackageNamei386 + "'? " + (hasi386 ? " *** YES *** " // + "(" + packageNameMap.get(targetPackageNamei386) + ")"*/
+ : " -no- "));
+ }
+ if (targetPackage != null && targetIndiv == null) {
+ System.out.println("Package, but no target individual found for " + targetPackageName);
+ }
+ if (targetIndiv == null) {
+ // Create target individual on the sport
+ targetIndiv = OWLUtils.createAndRegisterIndividual(ontologyIRI.toString(), targetPackageName,
VirtualPackageAlternativeIdentifier.CLASS_CUDF_PACKAGE, df, manager, ontology);
-
- createRelations(df, manager, ontologyIRI, ontology, packageIndiv, entry.getValue().getDepends(), OBJECTPROPERTY_CUDF_DEPENDS);
- createRelations(df, manager, ontologyIRI, ontology, packageIndiv, entry.getValue().getConflicts(), OBJECTPROPERTY_CUDF_CONFLICTS);
- createRelations(df, manager, ontologyIRI, ontology, packageIndiv, entry.getValue().getRecommends(), OBJECTPROPERTY_CUDF_RECOMMENDS);
- }
-
- // System.out.println("\tDone!");
-
- return ontology;
- }
-
- public static void createRelations(OWLDataFactory df, OWLOntologyManager manager, IRI ontologyIRI, OWLOntologyImpl ontology,
- OWLNamedIndividual packageIndiv, LinkedList<PackageRelation> depends, OWLObjectProperty objectproperty) {
- for (PackageRelation relation : depends) {
- // 2.I create the package individual
- OWLNamedIndividual dependendPackageIndiv = OWLUtils.createAndRegisterIndividual(ontologyIRI.toString(), relation.getTargetPackageName(),
- VirtualPackageAlternativeIdentifier.CLASS_CUDF_PACKAGE, df, manager, ontology);
-
- // 2.II Link the event individual to the entities
- OWLUtils.createRelation(packageIndiv, dependendPackageIndiv, ontology, df, manager, objectproperty);
- }
- }
+ // TODO: register it anywhere in a map?
+ // indivMap.put(targetPackageName, targetIndiv);
+ }
+ return targetIndiv;
+ }
+
}
class PackgeDetailsTask implements Callable<Package> {