/** * Creates a new RelationType with the given id. Adds the new RelationType * to the list of RelationTypes of this graph. * * @param id * id of the new RelationType * @return RelationType * @throws NullValueException * if any parameter is null. * @throws EmptyStringException * if id parameter is an empty string. * @throws UnsupportedOperationException * for read-only graphs */ public RelationType createRelationType(String id) throws NullValueException, EmptyStringException, UnsupportedOperationException { return createRelationType(id, ""); }
/** * Creates a new RelationType with the given id and parent RelationType. * Adds the new RelationType to the list of RelationTypes of this graph. * * @param id * id of the new RelationType * @param specialisationOf * parent RelationType * @return RelationType * @throws NullValueException * if any parameter is null. * @throws EmptyStringException * if id parameter is an empty string. * @throws UnsupportedOperationException * for read-only graphs */ public RelationType createRelationType(String id, RelationType specialisationOf) throws NullValueException, EmptyStringException, UnsupportedOperationException { return createRelationType(id, "", specialisationOf); }
/** * Creates a new RelationType with the given id and fullname. Adds the new * RelationType to the list of RelationTypes of this graph. * * @param id * id of the new RelationType * @param fullname * fullname of the new RelationType * @return RelationType * @throws NullValueException * if any parameter is null. * @throws EmptyStringException * if id parameter is an empty string. * @throws UnsupportedOperationException * for read-only graphs */ public RelationType createRelationType(String id, String fullname) throws NullValueException, EmptyStringException, UnsupportedOperationException { return createRelationType(id, fullname, ""); }
/** * Creates a new RelationType with the given id, fullname and description. * Adds the new RelationType to the list of RelationTypes of this graph. * * @param id * id of the new RelationType * @param fullname * fullname of the new RelationType * @param description * description of the new RelationType * @return RelationType * @throws NullValueException * if any parameter is null. * @throws EmptyStringException * if id parameter is an empty string. * @throws UnsupportedOperationException * for read-only graphs */ public RelationType createRelationType(String id, String fullname, String description) throws NullValueException, EmptyStringException, UnsupportedOperationException { return createRelationType(id, fullname, description, ""); }
/** * Creates a new RelationType with the given id, fullname and parent * RelationType. Adds the new RelationType to the list of RelationTypes of * this graph. * * @param id * id of the new RelationType * @param fullname * fullname of the new RelationType * @param specialisationOf * parent RelationType * @return RelationType * @throws NullValueException * if any parameter is null. * @throws EmptyStringException * if id parameter is an empty string. * @throws UnsupportedOperationException * for read-only graphs */ public RelationType createRelationType(String id, String fullname, RelationType specialisationOf) throws NullValueException, EmptyStringException, UnsupportedOperationException { return createRelationType(id, fullname, "", specialisationOf); }
/** * Creates a new RelationType with the given id, fullname, description and * inverseName. Adds the new RelationType to the list of RelationTypes of * this graph. * * @param id * id of the new RelationType * @param fullname * fullname of the new RelationType * @param description * description of the new RelationType * @param inverseName * inverse name of the new RelationType * @return RelationType * @throws NullValueException * if any parameter is null. * @throws EmptyStringException * if id parameter is an empty string. * @throws UnsupportedOperationException * for read-only graphs */ public RelationType createRelationType(String id, String fullname, String description, String inverseName) throws NullValueException, EmptyStringException, UnsupportedOperationException { return createRelationType(id, fullname, description, inverseName, false, false, false, false); }
/** * Creates a new RelationType with the given id, fullname, description and * parent RelationType. Adds the new RelationType to the list of * RelationTypes of this graph. * * @param id * id of the new RelationType * @param fullname * fullname of the new RelationType * @param description * description of the new RelationType * @param specialisationOf * parent RelationType * @return RelationType * @throws NullValueException * if any parameter is null. * @throws EmptyStringException * if id parameter is an empty string. * @throws UnsupportedOperationException * for read-only graphs */ public RelationType createRelationType(String id, String fullname, String description, RelationType specialisationOf) throws NullValueException, EmptyStringException, UnsupportedOperationException { return createRelationType(id, fullname, description, "", specialisationOf); }
RelationType specialisationOf) throws NullValueException, EmptyStringException, UnsupportedOperationException { return createRelationType(id, "", isAntisymmetric, isReflexive, isSymmetric, isTransitiv, specialisationOf);
public RelationType safeFetchRelationType(String id, String description) { RelationType rt = metaData.getRelationType(id); if (rt == null) { rt = metaData.getFactory().createRelationType(id, description); } return rt; }
protected static RelationType createRT(ONDEXGraphMetaData meta, String type) throws NullValueException, EmptyStringException{ RelationType rt = meta.getRelationType(type); if(rt == null)rt = meta.getFactory().createRelationType(type); return rt; }
protected static RelationType createRT(ONDEXGraphMetaData meta, String type) throws NullValueException, EmptyStringException{ RelationType rt = meta.getRelationType(type); if(rt == null)rt = meta.getFactory().createRelationType(type); return rt; }
public synchronized RelationType getRelationType ( String id, boolean isAntisymmetric, boolean isReflexive, boolean isSymmetric, boolean isTransitive ) { return this.cacheGet ( RelationType.class, id, () -> this.graph.getMetaData ().getFactory ().createRelationType ( id, isAntisymmetric, isReflexive, isSymmetric, isTransitive ) ); }
/** * Get relation type * * @param graph * @param type * @return */ public static RelationType createRT(final ONDEXGraph graph, final String type) { ONDEXGraphMetaData meta = graph.getMetaData(); RelationType rt = meta.getRelationType(type); if (rt == null) rt = meta.getFactory().createRelationType(type); return rt; }
/** * Get relation type * * @param graph * @param type * @return */ public static RelationType createRT(final ONDEXGraph graph, final String type) { ONDEXGraphMetaData meta = graph.getMetaData(); RelationType rt = meta.getRelationType(type); if (rt == null) rt = meta.getFactory().createRelationType(type); return rt; }
/** * Returns an RelationType for a given RelationType or RelationTypeSet ID. * * @param name - name of a RelationType or relationTypeSet * @return RelationType */ private RelationType getRelationType(String name) { RelationType rts = graph.getMetaData().getRelationType(name); if (rts != null) { return rts; } RelationType rt = graph.getMetaData().getRelationType(name); if (rt != null) { return graph.getMetaData().getFactory().createRelationType( rt.getId(), rt); } else { System.out.println("Entity Parser Missing RelationType: " + name); } return null; }
/** * Create a RelationType, if missing in metadata. * * @param name - Name of RelationType to be contained * @return RelationType */ private RelationType getRelationType(String name) { RelationType rt = aog.getMetaData().getRelationType(name); if (rt != null) { return aog.getMetaData().getFactory().createRelationType(rt.getId(),rt); } else { Parser.propagateEventOccurred( new RelationTypeMissingEvent("Missing RelationType: "+name, "getRelationType(String name)")); } return null; }
/** * Create a RelationType, if missing in metadata. * * @param name * Name of RelationType to be contained * @return RelationType */ private RelationType getRelationType(String name) { RelationType rt = aog.getMetaData().getRelationType(name); if (rt != null) { return aog.getMetaData().getFactory().createRelationType(rt.getId(), rt); } else { Parser.propagateEventOccurred(new RelationTypeMissingEvent( "Missing RelationType: " + name, "getRelationType(String name)")); } return null; }
ONDEXEventHandler.getEventHandlerForSID(graph.getSID()).fireEventOccurred(new RelationTypeMissingEvent("Missing:", is_a)); rtISA = graph.getMetaData().getFactory().createRelationType(is_a, rt); ONDEXEventHandler.getEventHandlerForSID(graph.getSID()).fireEventOccurred(new RelationTypeMissingEvent("Missing:", is_p)); rtISP = graph.getMetaData().getFactory().createRelationType(is_p, rt);
public synchronized RelationType getRelationType ( RelationTypePrototype proto ) { try { // Let's see if it has a parent if ( proto.getParent () == null ) { // Or a prototype to build it. In case of loops, this will lead to stack overflow RelationTypePrototype parentProto = proto.getParentPrototype (); if ( parentProto != null ) proto.setParent ( this.getRelationType ( parentProto ) ); } return this.cacheGet ( RelationType.class, proto.getId (), () -> this.graph.getMetaData ().getFactory ().createRelationType ( proto.getId (), proto.getFullName (), proto.getDescription (), proto.isAntisymmetric (), proto.isReflexive (), proto.isSymmetric (), proto.isTransitive (), proto.getParent () ) ); } catch ( StackOverflowError ex ) { log.error ( "Stack Overflow error while creating relation '{}'. Do you have circular references?", proto.getId () ); throw ex; } }
rt = graph.getMetaData().getRelationType(id); if (rt == null) { rt = graph.getMetaData().getFactory().createRelationType(id);