/** * Creates a new AttributeName with the given id, fullname, description and * datatype. Adds the new AttributeName to the list of AttributeNames of * this graph. * * @param id * id of the new AttributeName * @param fullname * fullname of the new AttributeName * @param description * description of the new AttributeName * @param datatype * datatype of the new AttributeName * @param specialisationOf * parent AttributeName of the new AttributeName * @return AttributeName * @throws NullValueException * if any parameter is null. * @throws EmptyStringException * if id parameter is an empty string. * @throws UnsupportedOperationException * for read-only graphs */ public AttributeName createAttributeName(String id, String fullname, String description, Class<?> datatype, AttributeName specialisationOf) throws NullValueException, EmptyStringException, UnsupportedOperationException { return md.createAttributeName(id, fullname, description, null, datatype, specialisationOf); }
/** * Creates a new AttributeName with the given id, fullname, description, * unit and datatype. Adds the new AttributeName to the list of * AttributeNames of this graph. * * @param id * id of the new AttributeName * @param fullname * fullname of the new AttributeName * @param description * description of the new AttributeName * @param unit * unit of the new AttributeName * @param datatype * datatype of the new AttributeName * @return AttributeName * @throws NullValueException * if any parameter is null. * @throws EmptyStringException * if id parameter is an empty string. * @throws UnsupportedOperationException * for read-only graphs */ public AttributeName createAttributeName(String id, String fullname, String description, Unit unit, Class<?> datatype) throws NullValueException, EmptyStringException, UnsupportedOperationException { return md.createAttributeName(id, fullname, description, unit, datatype, null); }
AttributeName specialisationOf) throws NullValueException, EmptyStringException, UnsupportedOperationException { return md.createAttributeName(id, fullname, description, unit, datatype, specialisationOf);
public void start() throws Exception { AttributeName att = this.graph.getMetaData().createAttributeName("fact", "fact", "Interesting fact", null, String.class, null); for (ONDEXRelation rel : this.graph.getRelations()) { rel.createAttribute(att, "bob", false); } }
AttributeName attNew = ondexMetaData.getAttributeName(name); if (attNew == null) attNew = ondexMetaData.createAttributeName(name, att.getFullname(), att.getDescription(), att.getUnit(), att.getDataType(), att.getSpecialisationOf());
/** * @param attNames * @param omd * copy from MetaData * @param nomd * copy to MetaData */ private void copyAttributeNames(Iterable<AttributeName> attNames, ONDEXGraphMetaData omd, ONDEXGraphMetaData nomd) { // "specializations_of"s that occur before there specialisation HashSet<AttributeName> atDependencyNotResolved = new HashSet<AttributeName>(); for (AttributeName att : attNames) { AttributeName spec = att.getSpecialisationOf(); AttributeName newSpec = null; if (spec != null) { newSpec = nomd.getAttributeName(spec.getId()); if (newSpec == null) { atDependencyNotResolved.add(att); continue; } } if (!nomd.checkAttributeName(att.getId())) nomd.createAttributeName(att.getId(), att.getFullname(), att .getDescription(), att.getUnit(), att.getDataType(), newSpec); } if (atDependencyNotResolved.size() > 0) { copyAttributeNames(atDependencyNotResolved, omd, nomd); } }
if (attribute_order == null) { attribute_order = graph.getMetaData() .createAttributeName(ORDER_ATTRIBUTE, ORDER_ATTRIBUTE, "Number of Concepts in subgraph", null, Integer.class, null);