@Override public void addTopicType(ValueGeneratorIF type) { topic.addType(type.getTopic()); }
private static void registerUntypedTopic(TopicIF topic, TopicMapIF tm) throws MalformedURLException { // topic to be an instance of on:untyped-topic topic.addType(getUntypedTopic(psibase, tm)); }
private static void copyTypes(TopicIF target, TopicIF source) { Iterator<TopicIF> it = source.getTypes().iterator(); while (it.hasNext()) target.addType(it.next()); }
@Override public TopicIF makeTopic(Collection<TopicIF> topic_types) { checkCollection(topic_types); TopicIF topic = createTopic(); Iterator<TopicIF> types = topic_types.iterator(); while (types.hasNext()) topic.addType(types.next()); return topic; }
@Override public TopicIF makeTopic(Collection topic_types) { checkCollection(topic_types); TopicIF topic = new Topic(txn); ((TopicMap)tm).addTopic(topic); Iterator types = topic_types.iterator(); while (types.hasNext()) topic.addType((TopicIF) types.next()); return topic; }
private static TopicIF registerNameType(TopicIF ntype, TopicMapIF tm) throws MalformedURLException { // topic to be an instance of on:name-type TopicIF nameType = tm.getTopicBySubjectIdentifier(psibase.resolveAbsolute("name-type")); ntype.addType(nameType); return ntype; }
private static TopicIF registerRoleType(TopicIF rtype, TopicMapIF tm) throws MalformedURLException { // topic to be an instance of on:role-type TopicIF roleType = tm.getTopicBySubjectIdentifier(psibase.resolveAbsolute("role-type")); rtype.addType(roleType); return rtype; }
protected static void addTypes(TopicIF topic, String[] types, Entity entity, String[] tuple, Context ctx) { for (int i = 0; i < types.length; i++) { TopicIF type = Utils.getTopic(types[i], ctx); if (type != null) topic.addType(type); else throw new DB2TMInputException("Topic type not found", entity, tuple, types[i]); } }
private static TopicIF registerRoleType(TopicIF rtype, TopicMapIF tm) throws MalformedURLException { // topic to be an instance of on:role-type TopicIF roleType = tm.getTopicBySubjectIdentifier(psibase.resolveAbsolute("role-type")); rtype.addType(roleType); return rtype; }
private static void registerTopicType(TopicIF topic, TopicMapIF tm) throws MalformedURLException { // topic to be an instance of on:topic-type TopicIF topicType = tm.getTopicBySubjectIdentifier(psibase.resolveAbsolute("topic-type")); topic.addType(topicType); }
protected static void addTypes(TopicIF topic, String[] types, Entity entity, String[] tuple, Context ctx) { for (int i = 0; i < types.length; i++) { TopicIF type = Utils.getTopic(types[i], ctx); if (type != null) topic.addType(type); else throw new DB2TMInputException("Topic type not found", entity, tuple, types[i]); } }
private static TopicIF registerAssociationType(TopicIF atype, TopicMapIF tm) throws MalformedURLException { // topic to be an instance of on:association-type TopicIF assocType = tm.getTopicBySubjectIdentifier(psibase.resolveAbsolute("association-type")); atype.addType(assocType); return atype; }
/** * Adds the topic type to the list of topic types that topic is a * direct instance of. */ public void addTopicType(TopicType type) { if (type == null) throw new OntopiaRuntimeException("The input parameter is null"); getTopicIF().addType(type.getTopicIF()); }
/** * Adds the topic type to the list of topic types that topic is a * direct instance of. */ public void addTopicType(TopicType type) { if (type == null) throw new OntopiaRuntimeException("The input parameter is null"); getTopicIF().addType(type.getTopicIF()); }
protected static void makePublicSystemTopic(TopicMapIF topicmap, LocatorIF base_on, LocatorIF base_t, String topic) { TopicIF systemTopic = getTopic(topicmap, base_on, "system-topic"); TopicIF publicSystemTopic = getTopic(topicmap, base_on, "public-system-topic"); TopicIF t = getTopic(topicmap, base_t, topic); t.removeType(systemTopic); t.addType(publicSystemTopic); }
public void perform(ActionParametersIF params, ActionResponseIF response) { //test params ActionSignature paramsType = ActionSignature.getSignature("t"); paramsType.validateArguments(params, this); TopicIF topic = (TopicIF) params.get(0); TopicIF type = (TopicIF) params.getTMObjectValue(); if (type == null) throw new ActionRuntimeException("No valid topic ID in request parameter; " + "cannot add topic type"); topic.addType(type); }
private static TopicIF registerOccurrenceType(TopicIF otype, TopicIF datatype, TopicMapIF tm) throws MalformedURLException { // topic to be an instance of on:occurrence-type TopicIF occType = tm.getTopicBySubjectIdentifier(psibase.resolveAbsolute("occurrence-type")); otype.addType(occType); // datatype addAssociation2(psibase.resolveAbsolute("has-datatype"), otype, psibase.resolveAbsolute("field-definition"), datatype, psibase.resolveAbsolute("datatype"), tm); return otype; }
public void testTopicRemovalPolicyTypeUse() { //! System.out.println("TM: " + tm.getTopics()); //! System.out.println("--0"); TopicIF topic = builder.makeTopic(); TopicIF other = builder.makeTopic(); //! System.out.println("--1"); other.addType(topic); //! System.out.println("--2"); topic.remove(); assertEquals("To many topics after remove", 0, topicmap.getTopics().size()); }
public void testDeleteInstanceOfSelf() { TopicIF topic = builder.makeTopic(); topic.addType(topic); topic.remove(); assertTrue("topic was not deleted", topic.getTopicMap() == null); }