You are here:
/ Dashboard / Main / WordPressSIOCRef

WordPress SIOC Reference

What is it about?

This article outlines the integration of data from WordPress into Virtuoso, allowing interaction through NNTP (for comments), and mapping WordPress data to the SIOC ontology for the purpose of constructing SPARQL? Queries against WordPress Weblog posts, comments, user and group data.

Why is it important?

Not only does the cross-protocol integration with NNTP allow another angle of input from users of legacy newsreaders, but constructing SPARQL? Queries offers a powerful feature of viewing the mapped to the SIOC ontology current WordPress data.

How does one use this feature?

What are the RDF Views supported?

Using Physical Graph URI

Key WP to SIOC Mappings

WP SIOC Sample Value
Only one Weblog Instance rdf:type sioc:Container
Instance Type rdf:type sioct:Weblog
Instance Description sioc:description "Just another WordPress weblog"
Instance link sioc:link "http://demo.openlinksw.com/wp#forum"

Data Space Post/Entry/Item Properties (sioc:Post predicates)


content
has_container
has_creator
id
link

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX sioc:   <http://rdfs.org/sioc/ns#>
PREFIX sioct: <http://rdfs.org/sioc/types#>
SELECT distinct ?attribute
FROM <http://demo.openlinksw.com/wp>
WHERE 
  {
    ?forum a sioct:Weblog .
    ?forum sioc:container_of ?post .
    ?post ?attribute ?o  
  }

Sample Data (Live Query Results)
  • Click *Here* for an Interactive-Web View of WordPress
  • Click *Here* for a live SPARQL Query (via SPARQL Protocol) against a WordPress.

Dump of all WordPress Posts


PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>  
PREFIX sioc: <http://rdfs.org/sioc/ns#> 
PREFIX sioct: <http://rdfs.org/sioc/types#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 
PREFIX dct: <http://purl.org/dc/elements/1.1/>
PREFIX dcc: <http://purl.org/dc/terms/> 
SELECT DISTINCT  ?post, ?title ?cr ?modified ?url  ?has_creator ?content 
FROM <http://demo.openlinksw.com/wp> 
WHERE    
  { 
    ?forum a sioct:Weblog .           
    ?forum sioc:container_of ?post. 
    optional{ ?post dct:title ?title }.
    optional{ ?post dcc:created ?cr }.
    optional{ ?post dcc:modified ?modified }.
    optional{ ?post sioc:has_creator ?has_creator}.
    optional{ ?post sioc:content  ?content }.
    optional{ ?post sioc:link ?url }.
  }
Sample Data (Live Query Results)
  • Click *Here* for an Interactive-Web View of WordPress
  • Click *Here* for a live SPARQL Query (via SPARQL Protocol) against a WordPress collection of posts.

Dump of all WordPress Users details


PREFIX sioc: <http://rdfs.org/sioc/ns#>
SELECT *
FROM <http://demo.openlinksw.com/wp>
WHERE
  {
    ?user a sioc:User .
    optional{ ?user sioc:name ?name}.
    optional{ ?user sioc:email ?email}.
  }
Sample Data (Live Query Results)
  • Click *Here* for an Interactive-Web View of WordPress
  • Click *Here* for a live SPARQL Query (via SPARQL Protocol) against a WordPress collection of posts.

Using Virtual Graph URI

Dump of all WordPress Weblog details


PREFIX sioc: <http://rdfs.org/sioc/ns#> 
PREFIX sioct: <http://rdfs.org/sioc/types#>
PREFIX dct: <http://purl.org/dc/elements/1.1/>
SELECT DISTINCT  ?title ?descr ?url 
FROM <http://demo.openlinksw.com/wp_v> 
WHERE    
  { 
    ?forum a sioct:Weblog .           
    optional{ ?forum dct:title ?title }.
    optional{ ?forum sioc:description ?descr }.
    optional{ ?forum sioc:link ?url }.
    optional{ ?forum sioc:has_host ?has_host}.
  }
Sample Data (Live Query Results)
  • Click *Here* for an Interactive-Web View of WordPress
  • Click *Here* for a live SPARQL Query (via SPARQL Protocol) against a WordPress collection.

Using SPARQL CONSTRUCT to Export SIOC-based RDF Data Sets

CONSTRUCT-based SPARQL queries are very useful when trying to expose RDF (via a SPARQL Endpoint) to RDF Data Set consumers that do not support SPARQL. In a sense, the SPARQL CONSTRUCT statements as part of a SPARQL Protocol payload deliver a Data Web (Web 3.0) Experience to Interactive-Web Clients (Web 1.0).

List of all registered WordPress members returned as an RDF Graph


PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX sioc: <http://rdfs.org/sioc/ns#>
CONSTRUCT
  {
    ?x rdf:type sioc:User . 
  }
FROM <http://demo.openlinksw.com/wp_v>
WHERE
  {
    ?x rdf:type sioc:User . 
  }

Reference

See also

Virtuoso and the Virtuoso Website are Copyright (C) OpenLink Software 2006-
SourceForge.net Logo