CREATE VIEW dbo.Resources
AS
SELECT SUBSTRING(c1.Value,50,37) AS ID,
c2.Value as Type,
c3.Value as [Size],
c4.Value as vFormat,
c5.Value as Mime,
c6.Value as Ref,
c7.Value As Lang,
SUBSTRING(c8.Value,50,37) As ParentID
FROM dbo.sparql ('
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dii: <urn:mpeg:mpeg21:2002:01-DII-NS#>
PREFIX did: <urn:mpeg:mpeg21:2002:02-DIDMODEL-NS#>
PREFIX imm: <http://schemas.microsoft.com/imm/2.0/core/>
SELECT ?s ?type ?size ?vFormat ?mime ?ref ?lang ?parent
FROM <http://schemas.microsoft.com/IMM/data>
WHERE
{
?s rdf:type did:Resource.
?parent did:ResourceCollection ?s.
OPTIONAL{
?s imm:ResourceType ?type.
?s imm:SizeInBytes ?size.
?s imm:VideoFormat ?vFormat.
?s did:MimeType ?mime.
?s did:Ref ?ref.
?s dc:language ?lang.
}
}
')