Difference between revisions of "Semantic MediaWiki/data/smw text2"
< Semantic MediaWiki | data
Jump to navigation
Jump to search
(fields) |
(documentation reconstructed from previously-written code) |
||
Line 1: | Line 1: | ||
==About== | ==About== | ||
* '''Version''': 1.7 | * '''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''': | * '''Fields''': | ||
** '''s_id''': [[../smw_ids|SMW ID]] of ''source page'' (page where property is being set) | ** '''s_id''': [[../smw_ids|SMW ID]] of ''source page'' (page where property is being set) | ||
Line 13: | Line 15: | ||
KEY `p_id` (`p_id`) | KEY `p_id` (`p_id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=binary;</mysql> | ) 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> |
Latest revision as of 15:53, 17 December 2012
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:
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>