<docbook><section><title>VirtRDFViewODSCalendar</title><bridgehead class="http://www.w3.org/1999/xhtml:h3">RDF View for ODS Calendar</bridgehead>
<emphasis>IMPORTANT!</emphasis> 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 <ulink url="VirtRDFViewODSGlobal">ODS RDF Views Deployment and Demo Scripts</ulink>.<programlisting>sparql prefix ods: &lt;http://www.openlinksw.com/virtuoso/ods/&gt;

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

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

   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
            #---
	  } .
    } .
;
</programlisting><para><ulink url="CategoryVirtuoso">CategoryVirtuoso</ulink> <ulink url="CategoryRDF">CategoryRDF</ulink> <ulink url="CategoryCalendar">CategoryCalendar</ulink></para>
</section></docbook>