wiki:Drupal/SemanticApi

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

Implemented in

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.

TracMath macro processor has detected an error. Please fix the problem before continuing.


The command:

'/usr/bin/pdflatex -interaction=nonstopmode a592894baf6c6cbd1eb707cd225abdcfc322832f.tex'
failed with the following output:
"This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian)\n restricted \\write18 enabled.\nentering extended mode\n(./a592894baf6c6cbd1eb707cd225abdcfc322832f.tex\nLaTeX2e <2011/06/27>\nBabel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, lo\naded.\n(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls\nDocument Class: article 2007/10/19 v1.4h Standard LaTeX document class\n(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))\n(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty\n(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def\n(/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.dfu)\n(/usr/share/texlive/texmf-dist/tex/latex/base/ot1enc.dfu)\n(/usr/share/texlive/texmf-dist/tex/latex/base/omsenc.dfu)))\n\n! LaTeX Error: File `cmap.sty' not found.\n\nType X to quit or <RETURN> to proceed,\nor enter new name. (Default extension: sty)\n\nEnter file name: \n! Emergency stop.\n<read *> \n         \nl.4 \\usepackage\n               {type1ec}^^M\n!  ==> Fatal error occurred, no output PDF file produced!\nTranscript written on a592894baf6c6cbd1eb707cd225abdcfc322832f.log.\n"

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.

Database Modifications

  • 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)

People

LeoSauermann created the module, contributions by GunnarGrimnes .

Sourcecode

subversion: https://organik.opendfki.de/repos/trunk/drupal/contributions/modules/semanticapi

for subversion read-only access, use http instead.

Last modified 7 years ago Last modified on 07/21/10 12:06:15