Ticket #490 (closed Enhancement: fixed)

Opened 7 years ago

Last modified 7 years ago

Property Index

Reported by: jri Owned by: jri
Priority: Major Milestone: Release 4.2
Component: DeepaMehta Standard Distribution Version: 4.1
Keywords: Cc: dgf, Malte
Complexity: 5 Area: Application Framework / API
Module: deepamehta-core

Description

Properties should be indexable and their should be by-value query methods. Range queries should be supported as well. This would allow e.g. to retrieve topics based on modification date (see #386).

Note: properties here mean the topic/association auxiliary data handled via the Core Service's getProperty, setProperty, and hasProperty methods.

Change History

comment:1 Changed 7 years ago by jri

  • Status changed from new to accepted

comment:2 Changed 7 years ago by jri

Core: revise property API (#490).

BREAKING CHANGES

The core service's property handling methods are no longer polymorph. Instead there are separate methods for topics and associations. The plugins and their APIs are adapted accordingly.
The formal parameter "key" is renamed to "propName". Its semantics have not changed.

Core Service:

  • getProperty(long objectId, String key) -> getTopicProperty(long topicId, String propName)

getAssociationProperty(long assocId, String propName)

  • setProperty(long objectId, String key, ...) -> setTopicProperty(long topicId, String propName, ...)

setAssociationProperty(long assocId, String propName, ...)

  • hasProperty(long objectId, String key) -> hasTopicProperty(long topicId, String propName)

hasAssociationProperty(long assocId, String propName)

Access Control Service:

  • getCreator(objectId) -> getTopicCreator(long topicId)

getAssociationCreator(long assocId)

  • setCreator(long objectId, String username) -> setTopicCreator(long topicId, String username)

setAssociationCreator(long assocId, String username)

  • getOwner(long objectId) -> getTopicOwner(long topicId)

getAssociationOwner(long assocId)

  • setOwner(long objectId, String username) -> setTopicOwner(long topicId, String username)

setAssociationOwner(long assocId, String username)

  • getACL(long objectId) -> getTopicACL(long topicId)

getAssociationACL(long assocId)

setAssociationACL(long assocId, AccessControlList? acl)

Time Service:

  • getTimeCreated(long objectId) -> getTopicCreationTime(long topicId)

getAssociationCreationTime(long assocId)

  • getTimeModified(long objectId) -> getTopicModificationTime(long topicId)

getAssociationModificationTime(long assocId)

=> If your plugin makes use of these methods it must be adapted.

In preparation to #490 (Property Index).
See #490.

Changeset: 4aefb7e8a10e64263943fda06df0a140d53d3a39

comment:3 Changed 7 years ago by jri

Core: indexing property values (#490).

BREAKING CHANGES

The core service's set-property methods got a 4th boolean parameter: addToIndex. If set to true the property value is indexded and thus available for being queried later on. (The actual query methods do not yet exist.)

Core Service:

  • setTopicProperty(long topicId, String propName, Object value, boolean addToIndex)
  • setAssociationProperty(long assocId, String propName, Object value, boolean addToIndex)

=> If your plugin makes use of these methods it must be adapted.

COMPATABILITY NOTE

Regarding the standard plugins these properties are now indexed:

Access Control: "creator", "owner"
Time: "created", "modified"

=> The "creator" and "owner" values of topics/associations existing in a DM 4.1 installation are not indexed retrospectively.
=> The "created" and "modified" timestamps are not added retrospectively to existing topics/associations of a DM 4.1 installation.

See #490.

Changeset: ec3fba60438dffe4edf1c3e16d5df78ba6a805c2

comment:4 Changed 7 years ago by jri

Core service: property value queries (#490).

The core service provides methods for quering topics/associations by property value.

For numeric property values range queries are supported as well. Range queries are particulary useful for timeline or geo coordinates. Range queries perform very efficiently. Numeric property values are indexed according the "Trie Indexing" approach.

DeepaMehtaService? interface has 4 new methods:

  • Collection<Topic> getTopicsByProperty(String propName, Object propValue);
  • Collection<Topic> getTopicsByPropertyRange(String propName, Number from, Number to);
  • Collection<Association> getAssociationsByProperty(String propName, Object propValue);
  • Collection<Association> getAssociationsByPropertyRange(String propName, Number from, Number to);

BREAKING CHANGE

DeepaMehtaStorage? interface has 4 new methods:

  • Collection<TopicModel?> fetchTopicsByProperty(String propName, Object propValue)
  • Collection<TopicModel?> fetchTopicsByPropertyRange(String propName, Number from, Number to)
  • Collection<AssociationModel?> fetchAssociationsByProperty(String propName, Object propValue)
  • Collection<AssociationModel?> fetchAssociationsByPropertyRange(String propName, Number from, Number to)

=> Storage layer implementations must implement these methods.

See #490.

Changeset: a6ded128b62959617f76955546405d96426825ca

comment:5 Changed 7 years ago by jri

  • Status changed from accepted to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.