RDF View for ODS Discussions

IMPORTANT! The following code is part of the ODS global VIEW regarding the Discussions part, it is not a separate VIEW and is strongly recommended NOT to be executed directly. Instead, you should use the code from ODS RDF Views Deployment and Demo Scripts.
sparql prefix ods: <http://www.openlinksw.com/virtuoso/ods/>

	# NNTPF
	create iri class ods:nntp_forum "http://^{URIQADefaultHost}^/dataspace/discussion/%U"
		( in forum_name varchar not null)
		option (returns "http://^{URIQADefaultHost}^/dataspace/discussion/%U").
	create iri class ods:nntp_post "http://^{URIQADefaultHost}^/dataspace/discussion/%U/%U"
		( in group_name varchar not null, in message_id varchar not null)
		option (returns  "http://^{URIQADefaultHost}^/dataspace/discussion/%U/%U" ) .
	create iri class ods:nntp_post_text "http://^{URIQADefaultHost}^/dataspace/discussion/%U/%U/text"
		( in group_name varchar not null, in message_id varchar not null)
		option (returns  "http://^{URIQADefaultHost}^/dataspace/discussion/%U/%U/text") .
	create iri class ods:nntp_role "http://^{URIQADefaultHost}^/dataspace/discussion/%U#reader"
		(in forum_name varchar not null)
		option (returns "http://^{URIQADefaultHost}^/dataspace/discussion/%U#reader") .


sparql
    prefix sioc: <http://rdfs.org/sioc/ns#>
    prefix sioct: <http://rdfs.org/sioc/types#>
    prefix atom: <http://atomowl.org/ontologies/atomrdf#>
    prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    prefix foaf: <http://xmlns.com/foaf/0.1/>
    prefix dc: <http://purl.org/dc/elements/1.1/>
    prefix dct: <http://purl.org/dc/terms/>
    prefix skos: <http://www.w3.org/2004/02/skos/core#>
    prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
    prefix bm: <http://www.w3.org/2002/01/bookmark#>
    prefix exif: <http://www.w3.org/2003/12/exif/ns/>
    prefix ann: <http://www.w3.org/2000/10/annotation-ns#>
    prefix wikiont: <http://sw.deri.org/2005/04/wikipedia/wikiont.owl#>
    prefix calendar: <http://www.w3.org/2002/12/cal#>
    prefix ods: <http://www.openlinksw.com/virtuoso/ods/>

   alter quad storage virtrdf:DefaultQuadStorage
       
      from DB.DBA.ODS_NNTP_GROUPS as nntp_groups
      from DB.DBA.ODS_NNTP_POSTS as nntp_posts
      from DB.DBA.ODS_NNTP_USERS as nntp_users
      where (^{nntp_users.}^.U_NAME = ^{users.}^.U_NAME)
      from DB.DBA.ODS_NNTP_LINKS as nntp_links

{
	create virtrdf:ODS_DS as graph ods:graph (users.U_NAME) option (exclusive)
	  {
	    #----
	    # NNTP
	    ods:nntp_forum (nntp_groups.NG_NAME) a sioct:MessageBoard ;
	    sioc:id nntp_groups.NG_NAME ;
	    sioc:description nntp_groups.NG_DESC .

	    ods:nntp_post (nntp_posts.NG_NAME, nntp_posts.NM_ID) a sioct:BoardPost ;
	    sioc:content nntp_posts.NM_BODY ;
	    dc:title nntp_posts.FTHR_SUBJ ;
	    dct:created  nntp_posts.REC_DATE ;
	    dct:modified nntp_posts.REC_DATE ;
	    foaf:maker ods:proxy (nntp_posts.MAKER) ;
	    sioc:reply_of ods:nntp_post (nntp_posts.NG_NAME, nntp_posts.FTHR_REFER) ;
	    sioc:has_container ods:nntp_forum (nntp_posts.NG_NAME) .

	    ods:nntp_post (nntp_posts.NG_NAME, nntp_posts.FTHR_REFER)
	    sioc:has_reply
	    ods:nntp_post (nntp_posts.NG_NAME, nntp_posts.NM_ID) .

	    ods:nntp_forum (nntp_posts.NG_NAME)
	    sioc:container_of
	    ods:nntp_post (nntp_posts.NG_NAME, nntp_posts.NM_ID) .


	    ods:nntp_role (nntp_groups.NG_NAME)
	    sioc:has_scope
	    ods:nntp_forum (nntp_groups.NG_NAME) .

	    ods:nntp_forum (nntp_groups.NG_NAME)
	    sioc:scope_of
	    ods:nntp_role (nntp_groups.NG_NAME) .

	    ods:user (nntp_users.U_NAME)
	    sioc:has_function
	    ods:nntp_role (nntp_users.NG_NAME) .

	    ods:nntp_role (nntp_users.NG_NAME)
	    sioc:function_of
	    ods:user (nntp_users.U_NAME) .

	    ods:nntp_post (nntp_links.NG_NAME, nntp_links.NML_MSG_ID)
	    sioc:links_to
	    ods:proxy (nntp_links.NML_URL) .
	    # end NNTP

            #---
	  } .
    } .
;

CategoryVirtuoso CategoryRDF CategoryDiscussions