Difference between revisions of "Semantic MediaWiki/data/smw ids"

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
(Created page with "==About== * '''Version''': 1.7 ==SQL== <mysql>CREATE TABLE `smw_ids` ( `smw_id` int(8) unsigned NOT NULL AUTO_INCREMENT, `smw_namespace` int(11) NOT NULL, `smw_title` va...")
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==About==
 
==About==
 
* '''Version''': 1.7
 
* '''Version''': 1.7
 +
* '''Documentation status''': unofficial; confirmed by testing only
 +
* '''Purpose''': assigns SMW-specific IDs to all SMW property-names and property-values, whether or not there is a corresponding MW page.
 +
* '''Fields''':
 +
** '''smw_namespace''': namespace that the corresponding page would have in MediaWiki
 +
** '''smw_title''': title (without namespace) that the corresponding page would have in MediaWiki
 
==SQL==
 
==SQL==
<mysql>CREATE TABLE `smw_ids` (
+
<source lang=mysql>CREATE TABLE `smw_ids` (
 
   `smw_id` int(8) unsigned NOT NULL AUTO_INCREMENT,
 
   `smw_id` int(8) unsigned NOT NULL AUTO_INCREMENT,
 
   `smw_namespace` int(11) NOT NULL,
 
   `smw_namespace` int(11) NOT NULL,
Line 13: Line 18:
 
   KEY `smw_sortkey` (`smw_sortkey`),
 
   KEY `smw_sortkey` (`smw_sortkey`),
 
   KEY `smw_title_2` (`smw_title`,`smw_namespace`,`smw_iw`,`smw_subobject`)
 
   KEY `smw_title_2` (`smw_title`,`smw_namespace`,`smw_iw`,`smw_subobject`)
) ENGINE=InnoDB AUTO_INCREMENT=10805 DEFAULT CHARSET=binary;</mysql>
+
) ENGINE=InnoDB AUTO_INCREMENT=10805 DEFAULT CHARSET=binary;</source>
 +
==Queries==
 +
This shows the values hidden in the binary blobs:
 +
<source lang=mysql>SELECT
 +
    smw_id,
 +
    smw_namespace,
 +
    CAST(smw_title AS CHAR) AS title,
 +
    CAST(smw_iw AS CHAR) iw,
 +
    CAST(smw_subobject AS CHAR) AS subobj,
 +
    CAST(smw_sortkey AS CHAR) AS sortkey
 +
FROM
 +
    pcrit_mw.smw_ids;</source>

Latest revision as of 20:43, 9 July 2020

About

  • Version: 1.7
  • Documentation status: unofficial; confirmed by testing only
  • Purpose: assigns SMW-specific IDs to all SMW property-names and property-values, whether or not there is a corresponding MW page.
  • Fields:
    • smw_namespace: namespace that the corresponding page would have in MediaWiki
    • smw_title: title (without namespace) that the corresponding page would have in MediaWiki

SQL

CREATE TABLE `smw_ids` (
  `smw_id` int(8) unsigned NOT NULL AUTO_INCREMENT,
  `smw_namespace` int(11) NOT NULL,
  `smw_title` varbinary(255) NOT NULL,
  `smw_iw` varbinary(32) NOT NULL,
  `smw_subobject` varbinary(255) NOT NULL,
  `smw_sortkey` varbinary(255) NOT NULL,
  PRIMARY KEY (`smw_id`),
  KEY `smw_title` (`smw_title`,`smw_namespace`,`smw_iw`),
  KEY `smw_sortkey` (`smw_sortkey`),
  KEY `smw_title_2` (`smw_title`,`smw_namespace`,`smw_iw`,`smw_subobject`)
) ENGINE=InnoDB AUTO_INCREMENT=10805 DEFAULT CHARSET=binary;

Queries

This shows the values hidden in the binary blobs:

SELECT 
    smw_id,
    smw_namespace,
    CAST(smw_title AS CHAR) AS title,
    CAST(smw_iw AS CHAR) iw,
    CAST(smw_subobject AS CHAR) AS subobj,
    CAST(smw_sortkey AS CHAR) AS sortkey
FROM
    pcrit_mw.smw_ids;