Semantic API Component
one of the OrganikComponents
The ontology is stored in the SemanticMetadataStore?. Interacting with the ontology (adding, removing, manipulating data) can only be done via this component. Reading the metadata from the metadata store may also be available via other components.
Typical functionalities are:
- adding ontologies
- adding taxonomies
- adding new concepts/classes to a taxonomy
- adding an ontological annotation to a document
- adding predicates
- adding rules
- Drupal/TaxonomyImport based on drupal taxonomy api
- Drupal/TaxonomyManager based on taxonomy_manager
Semantic API in drupal
The Semantic API component is an extension to the existing taxonomy module shipped with Drupal, adding features needed for OrganiK. As one feature, it allows other components to add a rank to terms, indicating which terms are more important than others. Other features include the calculation of a user-specific term-list and importing and exporting of taxonomies via module Drupal/TaxonomyImport.
How to use it?
Terms from the taxonomy can be valued with a rank, called term-rank. It expresses the importance of the term compared to other terms as floating number between 0 and 1. Terms with a higher rank are more important than terms with a lower rank.
Besides terms, the relation between a node and a term can also be ranked, called node-term-rank. A floating value between 0 and 1 expressing the relevance a term has for a given node. Higher ranked terms are more important for the given node than lower ranked terms.
The rank is shown in the GUI, higher ranked terms (by node_term.rank) are shown bigger based on a css class defined in semanticapi.css.
For each user, a list of user profile terms together with a weight is computed. The list is added as a block to the user profile page using the hook semanticapi_user with weight 15 and title "Your Profile".
How it works?
The term-ranks are precomputed by the TaxonomyLearningImplementation. The user profile terms and rank are computed based on summing all ranks of terms and term-node relations of nodes created by the user(not taking into account who added the tag). This can be expressed in the following formula, see also PersonalRecommendations.
N is the collection of nodes
Ranks are stored as additional float-column in the respective tables, which are initialized on the standardized drupal hooks semanticapi_schema_alter, semanticapi_install and semanticapi_uninstall.
- modifies term_data by adding "rank" - the rank is between 0..1 and defines how important the term is, according to the ContentAnalyserImplementation?
- modifies term_node by adding "rank" - the rank is between 0..1 and defines how important this term is for this document, according to the ContentAnalyserImplementation?
- modifies term_node by adding "state" - indicating if the term was automatically created by an algorithm (either auto-created by ContentAnalyserImplementation? or hand-created and already fitted into the hierarchy)
for subversion read-only access, use http instead.