Semantic MediaWiki/data/smw text2

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search

About

  • Version: 1.7
  • Documentation status: unofficial; confirmed only by testing
  • Purpose: defines semantic relationships between property-names and property-values, where the value-type is long text or data of some kind (no SMW ID)
  • Fields:
    • s_id: SMW ID of source page (page where property is being set)
    • p_id: SMW ID of property (name of property being used)
    • value_blob: the value to which the property has been set for this page

SQL

<mysql>CREATE TABLE `smw_text2` (

 `s_id` int(8) unsigned NOT NULL,
 `p_id` int(8) unsigned NOT NULL,
 `value_blob` mediumblob,
 KEY `s_id` (`s_id`),
 KEY `p_id` (`p_id`)

) ENGINE=InnoDB DEFAULT CHARSET=binary;</mysql>

Examples

<mysql> SELECT s_id, p_id

 , CAST(s.smw_title AS char) AS s_title
 , CAST(p.smw_title AS char) AS p_title
 , CAST(t.value_blob AS char) AS t_value
 FROM
   (smw_text2 AS t
   LEFT JOIN smw_ids AS s ON t.s_id=s.smw_id)
   LEFT JOIN smw_ids AS p ON t.p_id=p.smw_id;

</mysql>