input
stringlengths
10
828
output
stringlengths
5
107
public void assert configuration valid if null snapshot null model null gaboto throw new gaboto runtime exception either a snapshot or a jena and gaboto model have to be supplied if null snapshot null model null gaboto throw new gaboto runtime exception supplying a snapshot and a jena model gaboto model is ambiguous
tests whether this configuration can be used to create an
public integer get duration year return duration year null 0 duration year
returns the duration of years
public void exec sparqlselect string query sparqlquery solution processor processor query execution qexec query execution factory create query get model try execute query result set results qexec exec select iterate over results while results has next query solution soln results next solution process solution processor process solution soln continue if processor stop processing break finally qexec close
executes a select sparql query
public void set entity filters collection entity filter filters this entity filters filters
sets the entity filters to the provided collection
public void set duration year integer duration year if duration year null this duration year null else this duration year duration year 0 null duration year
sets the duration of years
public void clear entity filters this entity filters clear
empties the collection of entity filters
public void write output stream os model write os
serialise the model
public time instant get begin return new time instant get start year get start month get start day
creates a time instant that corresponds to the beginning of this time span
public void set resource filters collection resource filter filters this resource filters filters
sets the resource filters to the provided collection
public void clear resource filters this resource filters clear
empties the collection of resource filters
public void write output stream os string format model write os format
serialise the model
public boolean contains time instant ti test if beginning is later than this beginning time instant beginning this get begin int comp b ti compare to beginning if comp b 0 ti can unify beginning return true else if comp b 0 return false time instant end this get end int comp e ti compare to end if comp e 0 ti can unify end return true return false
tests whether a given point in time falls into this time span
public void set snapshot gaboto snapshot snapshot this snapshot snapshot
sets the pools snapshot
public void set resources collection resource resources this resources resources this set use resource collection true
sets the list of resources that are to be created
public void set config entity pool configuration config this pool config config
sets a new configuration object
public boolean contains time span ts time instant ts beginning ts get begin time instant ts end ts get end return contains ts beginning contains ts end
test whether a time span falls into this time span
public void add resource resource resource this resources add resource this set use resource collection true
adds a resource to the list of resources that are to be created
public boolean is add referenced entities to pool return add referenced entities to pool
returns whether or not referenced entities that were created are added to
public void filter entities collection entity filter filters collection gaboto entity entities to remove new hash set gaboto entity for entity filter filter filters for gaboto entity entity this get entities try filter applies to cast entity if filter filter entity entity entities to remove add entity catch class cast exception e on to the next one for gaboto entity entity entities to remove this remove entity entity
removes entities that do not fulfill all filter criteria
public boolean overlaps time span ts time instant ts beginning ts get begin time instant ts end ts get end return this get begin equals ts beginning contains ts beginning this get end equals ts end contains ts end
tests whether two time spans overlap
public void set add referenced entities to pool boolean add referenced entities to pool this add referenced entities to pool add referenced entities to pool
set whether or not referenced entities that were created are added to the
public void set accepted types collection string accepted types this accepted types accepted types
sets which types are to be created
public boolean has fixed duration return duration day null duration month null duration year null
tests whether this time span has an upper bound
public void add accepted type string type accepted types add type
adds another type to the list of accepted types
public void set unaccepted types collection string unaccepted types this unaccepted types unaccepted types
sets which types are not to be created
public void add unaccepted type string type unaccepted types add type
adds another type to the list of unaccepted types
public void set use resource collection boolean use resource collection this use resource collection use resource collection
tells the pool to use the resource collection
public boolean is use resource collection return use resource collection
returns whether or not the pool uses the resource collection
public void set create passive entities boolean create passive entities this create passive entities create passive entities
defines whether or not passive properties are to be resolved
public object get property value property prop return get property value prop get uri
returns the value of a property via reflection
public void remove entity gaboto entity entity entity map remove entity get uri
removes an entity from this pool
public gaboto entity add entity gaboto entity entity return add entity entity true
adds an entity to this pool
private gaboto entity add entity gaboto entity entity boolean direct add entity to list of directly added entities if direct if referenced entity map contains key entity get uri referenced entity map remove entity get uri direct entities add entity get uri entity set created from pool this add entity if direct pool config null pool config is add referenced entities to pool entity map put entity get uri entity else referenced entity map put entity get uri entity lazy initialization if pool config null pool config is enable lazy dereferencing entity resolve direct references return entity
adds an entity to this pool and allows for bypassing defined filters
public model create jena model model model model factory create default model for gaboto entity e entity map values if e get uri null throw new null pointer exception no uri set for e e add to model model return model
creates a jena
public model create jena model collection gaboto entity entities model model model factory create default model for gaboto entity e entities if this entity map contains key e get uri e add to model model return model
creates a jena
public gaboto snapshot create snapshot return new gaboto snapshot create jena model gaboto
creates an gaboto snapshot based on the information in this entity pool
public time span get time span return lifespan
returns the life span of this entity
public boolean contains entity string uri return entity map contains key uri
returns whether or not this pool contains the specified entity
public triple get rdftype triple return new triple node create uri get uri node create uri rdf type get uri node create uri get type
creates an rdf triple describing the type of this entity
public void add property time span ts ont property property object value add property ts property get uri value
adds a time bound property to this object
public time span get timespan return timespan
returns the time span that describes the graph the triple was added to
public triple get triple return triple
returns the triple that was added to the gaboto system
public void add property ont property property object value add property property get uri value
adds a property to this entity that is valid throughout its lifetime
public void add property string property uri object value test params test add property parameters property uri value remove anything like this property from universal properties remove property universal properties property uri go through each entity in the map and simply erase the property for entry time span list property entry property map entry set remove property entry get value property uri add property to universal property entity property new prop new property property uri value universal properties add new prop
adds a property to this entity that is valid throughout its lifetime
private void add property time span ts property property list property list null if property map contains key ts list property map get ts else list new array list property property map put ts list list add property
adds a property to the internal property map
private property remove property list property property list string property uri if list contains property erase it property prop to delete null for property p property list if p get property uri equals property uri prop to delete p break if null prop to delete property list remove prop to delete return prop to delete
removes a property from the passed property list
final public void set uri string uri this uri uri
sets the entitys uri
private boolean contains property list property property list string property uri for property p property list if p get property uri equals property uri return true return false
tests if property list contains the passed property
final public void set time span time span ts if ts null this timespan time span existence else this timespan ts canonicalize
stores the lifespan of this gaboto entity
public int get size return entity map size
returns the size of this entity pool
final public time span get time span return this timespan
returns the entitys lifespan
public boolean is direct references resolved return missing entity references is empty
tells whether direct references have been resolved for this entity
public void resolve direct references entity pool pool if is direct references resolved return if pool null throw new illegal state exception the gaboto entity was not provided with a pool object to resolve its references from add missing references pool add missing references for entity missing entity references values missing entity reference callbacks
tries to resolve the entitys direct references from the passed pool
public void set passive entities loaded this passive entities loaded true
tells the entity that all passive properties were loaded
public void load passive entities load passive entities create from pool
tries to load passive entities from the entitys pool
public time dimension indexer get time dimension indexer if time dimension indexer null throw new no time index set exception return time dimension indexer
returns the time dimension indexer
public void load passive entities entity pool pool if passive entities loaded return if pool null throw new illegal state exception the gaboto entity was not provided with a pool object to load the passive properties from pool add passive entities for this
tries to load passive entities from the passed pool
public void add to model model model graph g model get graph list triple triples get triples for for triple t triples g add t
the entity adds itself to the supplied jena model
public void set time dimension indexer time dimension indexer idx this time dimension indexer idx
sets a time dimension indexer
public void recreate time dimension index this get time dimension indexer create index get context description graph
triggers a recreation of the time dimension index
public object get property value property prop boolean search in passive properties boolean search in indirect properties return get property value prop get uri search in passive properties search in indirect properties
returns the value of a property via reflection
public void attach update listener update listener listener update listeners add listener
attaches a listener that is informed on updates to the graph
public void detach update listener update listener listener update listeners remove listener
detaches an update listener
public object get passive property value property prop return get passive property value prop get uri
returns the value of a passive property
public string generate id uri string tmp id generate id while contains resource tmp id tmp id generate id return tmp id
generates a new id unique within this gaboto
public object get passive property value string prop uri method m gaboto entity utils get passive get method for this get class prop uri if m null try system err println for class this get class found passive method m get name m invoke this object null return m invoke this object null catch invocation target exception e throw new gaboto runtime exception e get cause catch exception e throw new gaboto runtime exception e return null
returns the value of a passive property
public void load from snapshot resource res gaboto snapshot snapshot entity pool pool set uri this set uri res get uri log logger debug load entity this get uri from snapshot try to set time span this set time span snapshot get time span for entity res load entity rdfcontainer loader impl get instance load from snapshot this res snapshot pool
creates the java representation from an gaboto snapshot and a resource object
private void trigger update event gaboto event e for update listener u update listeners u update occured e
informs listeners of update
public int get collect properties return collect properties
returns which properties are to be collected
private void add name to element document kml doc element parent el gaboto entity entity string name string entity get property value dcvocab title if name null traverse to parent if is display parent name name get parents name recursive entity add name to placemark element name el kml doc create element ns kml ns name name el append child kml doc create text node name parent el append child name el
tries to find the name that should be added to the placemark
public void set entity folder types map string collection string entity folder types this entity folder types entity folder types
each entity type set here is transformed into a kml folder element
synchronized public void purge gaboto entity entity purge entity get uri
removes all direct information about the supplied entity
synchronized public void purge gaboto time based entity entity purge entity get uri
removes all direct information about the supplied entity
private jsonwriter append string s throws jsonexception if s null throw new jsonexception null pointer if this mode o this mode a try if this comma this mode a this writer write note tpp change here this writer write n for int i 0 i this top i this writer write this writer write s catch ioexception e throw new jsonexception e if this mode o this mode k this comma true return this throw new jsonexception value out of sequence
append a value
synchronized public void purge string entity uri if contains entity entity uri throw new entity does not exist exception entity uri system err println attempting to purge entity uri load time based entity iterator it get named graph set find quads node any node create uri entity uri node any node any while it has next quad q quad it next remove q old way time span ts time span create from graph name q get graph name get uri this remove ts q get triple
removes all direct information about the supplied entity
public jsonwriter key string s throws jsonexception if s null throw new jsonexception null key if this mode k try note tpp change here stack top 1 put once s boolean true if this comma this writer write n for int i 0 i this top i this writer write this writer write jsonobject quote s this writer write this comma false this mode o return this catch ioexception e throw new jsonexception e throw new jsonexception misplaced key
append a key
synchronized public void remove gaboto entity entity remove entity entity get time span
this method removes an entity from the graph described by its lifetime
synchronized public void remove gaboto entity entity time span ts for triple t entity get triples for true remove ts t
this method removes an entity from the graph described by the supplied
synchronized public void add triple triple get global knowledge graph add triple inform listeners trigger update event new insertion gaboto event triple
adds a triple to the general knowledge graph
synchronized public void remove triple triple get global knowledge graph delete triple inform listeners trigger update event new removal gaboto event triple
removes a triple from the general knowledge graph
synchronized public named graph add time span ts triple triple if ts null ts equals time span existence add triple return null named graph graph if contains graph ts graph get graph ts else graph create new graph ts update the index try get time dimension indexer add graph ts catch no time index set exception e graph add triple inform listeners trigger update event new insertion gaboto event ts triple return graph
adds a triple to that graph corresponding to the supplied time span
synchronized public void remove time span ts triple triple if ts null ts equals time span existence remove triple return if contains graph ts named graph graph get graph ts graph delete triple trigger update event new removal gaboto event ts triple
removes an rdf triple from that graph corresponding to the supplied time
synchronized public void remove quad q get named graph set remove quad q trigger update event new removal gaboto event q
removes a quad from gaboto and triggers and update event
private string get graph name for time span ts return config get nsgraphs tg ts to string
returns the name of a potential graph for this timespan
protected string substitute string s in string s s in for iterator replacement i m replacements iterator i has next replacement r i next s r pattern matcher s replace all r sub return s
use the current replacements list to do the subs in the given string
public named graph set get named graph set return this named graph set
returns the underlying named graph set
public boolean contains graph time span ts return this get named graph set contains graph get graph name for ts
tests if this gaboto instance knows of a graph described by this timespan
public boolean contains graph string uri return this get named graph set contains graph uri
tests if gaboto contains a graph with the passed uri
public named graph get graph string uri return this get named graph set get graph uri
returns the named graph or null
public named graph get graph time span ts return this get named graph set get graph get graph name for ts
returns the corresponding graph
public named graph get global knowledge graph return named graph set get graph config get global knowledge graph uri
returns the global knowledge graph
public model get context description graph return context description graph
returns the context description graph
public model get jena model view on named graph set return get named graph set as jena model config get default graph uri
returns a jena model view on the underlying named graph set
public boolean contains entity gaboto entity entity return contains entity entity get uri
tests whether the passed entity exists
public boolean contains entity string uri if uri null throw new illegal argument exception uri may not be null return get named graph set contains quad new quad node any node create uri uri node create uri rdf type get uri node any
tests whether the passed entity exists
public gaboto entity get entity string uri time instant ti if contains entity uri throw new entity does not exist exception uri gaboto snapshot snap get snapshot ti return snap load entity uri
loads an entity at a given point in time
public gaboto time based entity get entity over time string uri if contains entity uri throw new entity does not exist exception uri return gaboto time based entity load entity uri this
loads an entity with all its data
public boolean contains resource string uri return get named graph set contains quad new quad node any node create uri uri node any node any
tests whether the system contains data about the specified resource
private string get literal get method element property switch get literal type property case literal type string return get string case literal type integer return get int case literal type float return get float case literal type double return get double case literal type boolean return get boolean case literal type datetime return get string case literal type date return get string return null
returns the appropriate method name for returning a literals value
protected void write model declaration if use ontology string lang owl if is true opt lang daml lang daml else if is true opt lang rdfs lang rdfs writeln 1 p the ontology model that holds the vocabulary terms p writeln 1 public static ont model model model factory create ontology model ont model spec lang mem null else writeln 1 p the rdf model that holds the vocabulary terms p writeln 1 public static model model model factory create default model writeln 1
write the declaration of the model