/** * Adding the subject, predicate and object components to this container. * * @param subject * The subject term of the Function. * @param predicate * The Function predicate. * @param object * The object term of the Function. */ void put(String subject, String predicate, String object) { // Subject to Predicates map ArrayList<String> predicateList = subjectToPredicates.get(subject); if (predicateList == null) { predicateList = new ArrayList<String>(); } insert(predicateList, predicate); subjectToPredicates.put(subject, predicateList); // Predicate to Objects map ArrayList<String> objectList = predicateToObjects.get(predicate + "_" + subject); // predicate that appears in 2 different subjects should not have all objects assigned to both subjects if (objectList == null) { objectList = new ArrayList<String>(); } objectList.add(object); predicateToObjects.put(predicate + "_" + subject, objectList); }
/** * Adding the subject, predicate and object components to this container. * * @param subject * The subject term of the Function. * @param predicate * The Function predicate. * @param object * The object term of the Function. */ void put(String subject, String predicate, String object) { // Subject to Predicates map ArrayList<String> predicateList = subjectToPredicates.get(subject); if (predicateList == null) { predicateList = new ArrayList<String>(); } insert(predicateList, predicate); subjectToPredicates.put(subject, predicateList); // Predicate to Objects map ArrayList<String> objectList = predicateToObjects.get(predicate + "_" + subject); // predicate that appears in 2 different subjects should not have all objects assigned to both subjects if (objectList == null) { objectList = new ArrayList<String>(); } objectList.add(object); predicateToObjects.put(predicate + "_" + subject, objectList); }