Download
Cover
Contents
Milestone One
Milestone Two
Milestone Three
Appendix
Diary
Biblography
Code Samples
background image
Previous
04029437
m2.17
long time period. This may be the internal or external moulds of, usually, the
hard parts of an organism (shells, bones, etc.).</skos:scopeNote>
</skos:Concept>
</rdf:RDF>
It is important to note the use of the
rdf
and
skos
XML namespaces in the root RDF
element. To emphasise this, the sample below highlights the important namespace
declarations.
Code Sample 48
<rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22
xmlns:rdf="http://www.w3.org/1999/02/22
xmlns:rdf="http://www.w3.org/1999/02/22
xmlns:rdf="http://www.w3.org/1999/02/22-
-
-
-rdf
rdf
rdf
rdf-
-
-
-syntax
syntax
syntax
syntax-
-
-
-ns#"
ns#"
ns#"
ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#">
This SKOS file when converted to SQL will produce the output shown below. Note that
no primary or foreign keys are defined. This is due to limitations of MySQL that prevent
fields greater than 100 bytes being used as indexes. Since SKOS URIs are generally
longer than this, we are forced to use a
varchar(255)
field as an un-enforced key. The
maximum size varchar field is 255, and because MySQL does not support multi-byte characters,
this is a 255 byte field
. One could overcome this by using an alternative database engine,
such as PostgreSQL, which does support data types that would allow for more complex
keys.
Code Sample 49
#
# SKOS to SQL
# ===========
#
#
# Create Tables
#
DROP TABLE IF EXISTS `concept`;
CREATE TABLE `concept` (`concept` varchar(255) NOT NULL, `description`
mediumtext NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `conceptConcept`;
CREATE TABLE `conceptConcept` (`concept` varchar(255) NOT NULL,
`conceptRelated` varchar(255) NOT NULL, `relationship` varchar(255) NOT NULL)
ENGINE=MyISAM DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `conceptWord`;
CREATE TABLE `conceptWord` (`concept` varchar(255) NOT NULL, `word`
varchar(255) NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=utf8;
#
# Concept : http://reswin1.isd.glam.ac.uk/star/rdf/concepts#97712
#
INSERT INTO `concept` VALUES
("http://reswin1.isd.glam.ac.uk/star/rdf/concepts#97712", "Pertaining to or
deriving from a living organism. See ANIMAL Class list for narrow terms.");
INSERT INTO `conceptWord` VALUES
("http://reswin1.isd.glam.ac.uk/star/rdf/concepts#97712", "ANIMAL");
INSERT INTO `conceptConcept` VALUES
("http://reswin1.isd.glam.ac.uk/star/rdf/concepts#97712",
"http://reswin1.isd.glam.ac.uk/star/rdf/concepts#97764", "narrower");
INSERT INTO `conceptConcept` VALUES
("http://reswin1.isd.glam.ac.uk/star/rdf/concepts#97712",
"http://reswin1.isd.glam.ac.uk/star/rdf/concepts#97929", "narrower");
#
# Concept : http://reswin1.isd.glam.ac.uk/star/rdf/concepts#97764
#
INSERT INTO `concept` VALUES
("http://reswin1.isd.glam.ac.uk/star/rdf/concepts#97764", "Any of the pieces
of hard tissue consisting largely of calcium phosphate that make up the
skeleton of a vertebrate animal.");
INSERT INTO `conceptWord` VALUES
("http://reswin1.isd.glam.ac.uk/star/rdf/concepts#97764", "BONE");
INSERT INTO `conceptConcept` VALUES
Navigation