Semantic MediaWiki/data/smw di blob

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< Semantic MediaWiki‎ | data
Revision as of 15:25, 14 February 2013 by Woozle (talk | contribs) (Created page with "==About== * '''Purpose''': specifications for all SMW Objects that are text-blobs (i.e. long text which cannot be associated with a wiki page) * '''Refers to''': {{l/same|smw_...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

About

  • Purpose: specifications for all SMW Objects that are text-blobs (i.e. long text which cannot be associated with a wiki page)
  • Refers to: smw_object_ids

SQL

<mysql> delimiter $$

CREATE TABLE `smw_di_blob` (

 `s_id` int(8) unsigned NOT NULL,
 `p_id` int(8) unsigned NOT NULL,
 `o_blob` mediumblob,
 `o_hash` varbinary(255) DEFAULT NULL,
 KEY `s_id` (`s_id`,`p_id`),
 KEY `p_id` (`p_id`,`o_hash`)

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

Example

<mysql> SELECT s_id, p_id

 , s.smw_namespace AS s_namespace
 , CAST(s.smw_title AS char) AS s_title
 , p.smw_namespace AS p_namespace
 , CAST(p.smw_title AS char) AS p_title
 , CAST(o_blob AS CHAR) as text
 , CAST(o_hash AS CHAR) as hash

FROM

   (smw_di_blob AS r
   LEFT JOIN smw_object_ids AS s ON r.s_id=s.smw_id)
   LEFT JOIN smw_object_ids AS p ON r.p_id=p.smw_id

ORDER BY s_id </mysql>

  • p_namespace will probably always be the "property:" namespace, which defaults to 102 (unless there's some way to use a page outside that namespace as a property)