/** Return all WasDerivedFrom edges with entity a as a cause. */ public Collection<WasDerivedFrom> getWasDerivedFromWithCause(Entity a) { return entityCauseWasDerivedFromMap.get(a.getId()); }
public Entity addAttributes(Entity from, Entity to) { to.getLabel().addAll(from.getLabel()); to.getType().addAll(from.getType()); to.getLocation().addAll(from.getLocation()); to.getOther().addAll(from.getOther()); return to; }
@Override public void doAction(Entity e) { register(e.getId()); registerLocation(e.getLocation()); registerType(e.getType()); registerValue(e.getValue()); registerOther(e.getOther()); }
Hashtable<Integer,QualifiedName> map=new Hashtable<Integer, QualifiedName>(); Hashtable<Integer, Hashtable<Integer,TypedValue>> map2=new Hashtable<Integer, Hashtable<Integer,TypedValue>>(); for (Other attr: entity.getOther()) { String uri = attr.getElementName().getUri(); if (uri.startsWith(APP_VALUE)) { set(entry.getKey(),ll,entry.getValue()); result.getVariables().put(entity.getId(),ll); result.getAttributes().put(entity.getId(),allvalues);
public void add2DvaluesOLD(List<StatementOrBundle> ll, Hashtable<QualifiedName, List<List<TypedValue>>> attributes) { for (Entry<QualifiedName, List<List<TypedValue>>> entry: attributes.entrySet()) { Entity e=pf.newEntity(entry.getKey()); int count1=0; List<Other> attrs=new LinkedList<Other>(); for (List<TypedValue> vals: entry.getValue()) { int count2=0; for (TypedValue val: vals) { attrs.add(pf.newOther(TMPL_NS, VALUE2+count1+"_"+count2, TMPL_PREFIX, val.getValue(), val.getType())); count2++; } count1++; } e.getOther().addAll(attrs); ll.add(e); } } public void add2Dvalues(List<Statement> ll, Hashtable<QualifiedName, List<List<TypedValue>>> attributes) {
public void testEntity0() { Entity a = pFactory.newEntity(q("e0")); a.getOther() .add(pFactory.newOther(pFactory.newQualifiedName(EX_NS, "tag2", EX_PREFIX), pFactory.newInternationalizedString("bonjour", a.getLocation().add(pFactory.newLocation("un llieu", name.XSD_STRING)); a.getLocation().add(pFactory.newLocation(1, name.XSD_INT)); a.getLocation() .add(pFactory.newLocation(2.0, name.XSD_DOUBLE)); a.getLocation().add(pFactory.newLocation(EX_NS + "london", name.XSD_ANY_URI)); a.getLocation().add(loc);
public HashMap<String,String> addEntityShape(Entity p, HashMap<String,String> properties) { // default is good for entity List<Type> types=p.getType(); for (Type type: types) { if (type.getValue() instanceof QualifiedName) { QualifiedName name=(QualifiedName) type.getValue(); if (("Dictionary".equals(name.getLocalPart())) || ("EmptyDictionary".equals(name.getLocalPart()))) { properties.put("shape","folder"); } } } return properties; }
/** * Creates a new {@link Entity} with provided identifier and label * @param id a {@link QualifiedName} for the entity * @param label a String for the label property (see {@link HasLabel#getLabel()} * @return an object of type {@link Entity} */ public Entity newEntity(QualifiedName id, String label) { Entity res = newEntity(id); if (label != null) res.getLabel().add(newInternationalizedString(label)); return res; }
/** * Creates a new {@link Entity} with provided identifier * @param id a {@link QualifiedName} for the entity * @return an object of type {@link Entity} */ public Entity newEntity(QualifiedName id) { Entity res = of.createEntity(); res.setId(id); return res; }
public void testEntityWithOneLocationAttribute(int i) { Entity a = pFactory.newEntity(q("en_l" + i)); Object [] pair= attributeValues[i]; Object value=pair[0]; QualifiedName type=(QualifiedName) pair[1]; a.getLocation().add(pFactory.newLocation(value,type)); makeDocAndTest(a,"target/attr_entity_one_location_attr"+i); }
Hashtable<Integer,QualifiedName> map=new Hashtable<Integer, QualifiedName>(); Hashtable<Integer, Hashtable<Integer,TypedValue>> map2=new Hashtable<Integer, Hashtable<Integer,TypedValue>>(); for (Other attr: entity.getOther()) { String uri = attr.getElementName().getUri(); if (uri.startsWith(APP_VALUE)) { set(entry.getKey(),ll,entry.getValue()); result.getVariables().put(entity.getId(),ll); result.getAttributes().put(entity.getId(),allvalues);
@Override public void doAction(Entity e) { register(e.getId()); registerLocation(e.getLocation()); registerType(e.getType()); registerValue(e.getValue()); registerOther(e.getOther()); }
public void add2DvaluesOLD(List<StatementOrBundle> ll, Hashtable<QualifiedName, List<List<TypedValue>>> attributes) { for (Entry<QualifiedName, List<List<TypedValue>>> entry: attributes.entrySet()) { Entity e=pf.newEntity(entry.getKey()); int count1=0; List<Other> attrs=new LinkedList<Other>(); for (List<TypedValue> vals: entry.getValue()) { int count2=0; for (TypedValue val: vals) { attrs.add(pf.newOther(TMPL_NS, VALUE2+count1+"_"+count2, TMPL_PREFIX, val.getValue(), val.getType())); count2++; } count1++; } e.getOther().addAll(attrs); ll.add(e); } } public void add2Dvalues(List<Statement> ll, Hashtable<QualifiedName, List<List<TypedValue>>> attributes) {
public HashMap<String,String> addEntityShape(Entity p, HashMap<String,String> properties) { // default is good for entity List<Type> types=p.getType(); for (Type type: types) { if (type.getValue() instanceof QualifiedName) { QualifiedName name=(QualifiedName) type.getValue(); if (("Dictionary".equals(name.getLocalPart())) || ("EmptyDictionary".equals(name.getLocalPart()))) { properties.put("shape","folder"); } } } return properties; }
/** * Creates a new {@link Entity} with provided identifier and label * @param id a {@link QualifiedName} for the entity * @param label a String for the label property (see {@link HasLabel#getLabel()} * @return an object of type {@link Entity} */ public Entity newEntity(QualifiedName id, String label) { Entity res = newEntity(id); if (label != null) res.getLabel().add(newInternationalizedString(label)); return res; }
/** * Creates a new {@link Entity} with provided identifier * @param id a {@link QualifiedName} for the entity * @return an object of type {@link Entity} */ public Entity newEntity(QualifiedName id) { Entity res = of.createEntity(); res.setId(id); return res; }
/** Return all WasDerivedFrom edges with entity a as an effect . */ public Collection<WasDerivedFrom> getWasDerivedFromWithEffect(Entity a) { return entityEffectWasDerivedFromMap.get(a.getId()); }
public Entity addAttributes(Entity from, Entity to) { to.getLabel().addAll(from.getLabel()); to.getType().addAll(from.getType()); to.getLocation().addAll(from.getLocation()); to.getOther().addAll(from.getOther()); return to; }