RDF View for ODS Calendar

IMPORTANT! The following code is part of the ODS global VIEW regarding the Calendar 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/>

	#Calendar
	create iri class ods:calendar_event "http://^{URIQADefaultHost}^/dataspace/%U/calendar/%U/%d"
		(in uname varchar not null, in inst_name varchar not null, in calendar_id integer not null)
		option (returns "http://^{URIQADefaultHost}^/dataspace/%U/calendar/%U/%d" ) .
	create iri class ods:calendar_event_text "http://^{URIQADefaultHost}^/dataspace/%U/calendar/%U/%d/text"
		(in uname varchar not null, in inst_name varchar not null, in calendar_id integer not null)
		option (returns "http://^{URIQADefaultHost}^/dataspace/%U/calendar/%U/%d/text" ) .
	create iri class ods:calendar_forum "http://^{URIQADefaultHost}^/dataspace/%U/calendar/%U"
		( in uname varchar not null, in forum_name varchar not null)
		option (returns  "http://^{URIQADefaultHost}^/dataspace/%U/calendar/%U") .


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_CALENDAR_EVENTS as cal_events
      where (^{cal_events.}^.U_NAME = ^{users.}^.U_NAME)
      from DB.DBA.ODS_CALENDAR_TAGS as cal_tags
      where (^{cal_tags.}^.U_NAME = ^{users.}^.U_NAME)

{
	create virtrdf:ODS_DS as graph ods:graph (users.U_NAME) option (exclusive)
	  {
	    #----

            # Calendar
            ods:calendar_event (cal_events.U_NAME, cal_events.WAI_NAME, cal_events.E_ID) a calendar:vevent option (EXCLUSIVE) ;
	    dc:title cal_events.E_SUBJECT ;
	    dct:created cal_events.E_CREATED ;
	    dct:modified cal_events.E_UPDATED ;
	    dc:date cal_events.E_UPDATED ;
	    ann:created cal_events.E_CREATED ;
	    dc:creator cal_events.U_NAME ;
	    sioc:link ods:proxy (cal_events.E_URI) ;
	    sioc:content cal_events.E_DESCRIPTION ;
	    sioc:has_creator ods:user (cal_events.U_NAME) ;
	    foaf:maker ods:person (cal_events.U_NAME) ;
	    sioc:has_container ods:calendar_forum (cal_events.U_NAME, cal_events.WAI_NAME) .

	    ods:calendar_forum (cal_events.U_NAME, cal_events.WAI_NAME) sioc:container_of ods:calendar_event (cal_events.U_NAME, cal_events.WAI_NAME, cal_events.E_ID) .

	    ods:user (cal_events.U_NAME) sioc:creator_of ods:calendar_event (cal_events.U_NAME, cal_events.WAI_NAME, cal_events.E_ID) .

	    ods:calendar_event (cal_tags.U_NAME, cal_tags.WAM_INST, cal_tags.ITEM_ID)
	    sioc:topic ods:tag (cal_tags.U_NAME, cal_tags.E_TAG) .

	    ods:tag (cal_tags.U_NAME, cal_tags.E_TAG) a skos:Concept ;
	    skos:prefLabel cal_tags.E_TAG ;
	    skos:isSubjectOf ods:calendar_event (cal_tags.U_NAME, cal_tags.WAM_INST, cal_tags.ITEM_ID) .     
	    # end Calendar
            #---
	  } .
    } .
;

CategoryVirtuoso CategoryRDF CategoryCalendar