. "2017-06-29T07:32:35Z" . . . . . . . . . . . . . . . "2017-06-13T06:05:13.585020"^^ . . . . . "VOSODSSparqlSamples" . "7a424af746f10efe9b4a0f45fd13eaf1" . "VOSODSSparqlSamples" . . . . . . "2017-06-13T06:05:13Z" . . . "2017-06-29T07:32:35.758919"^^ . . . . . "%META:TOPICPARENT{name=\"VOSSPARQL\"}%\n\n---++ SPARQL Sample Queries using Live Demonstration Data\nThis page presents examples of querying ODS RDF Graph via SPARQL.\n\n---+++Querying ODS Data via RDF data mapped to SIOC Ontology\n\nGraph IRI format: http://<cname>/dataspace\n\nExamples:\n\n 1 Public Demo Server Instance: http://demo.openlinksw.com/dataspace\n 1 MyOpenLink Services (a demo instance of ODS): http://myopenlink.net/dataspace\n\n---++++Setup Guide\n\n * MyOpenLink.net Service: You can either log on as user: test1, pwd: 1 or create a new account at http://myopenlink.net:8890/ods. \n\n * Live Demo Server: You can either log on as user: demo, pwd: demo or create a new account at: http://demo.openlinksw.com/ods \n\nIf you are creating a new account, please perform the following steps:\n\n 1 Register under a username of your choosing\n 1 Create ODS Application instances (aka Data Space Applications) for Briefcase, FeedManager, Mail, Blog, Wiki, Gallery, Bookmarks.\n 1 Log under new user or use account: test1 and then proceed to the \"My Weblog\"\n 1 Create a few sample blog posts \n 1 Go to the \"My Wiki\" tab\n 1 Create a sample Wiki article: Test1Sample, for instance\n 1 Go to the Wiki Cluster Settings and press `Turn On' to enable Conversations\n 1 Verify the \"Conversation\" feature by going to the \"Discussions\" tab in your ODS home, to see if a newsgroup has been automatically generated for your Wiki article. It should appear as: \"oWiki-test1Wiki\" assuming this is the name of your Wiki Data Space Instance\n 1 From the WelcomeVisitors page clicks the Conversations link and sends one reply with body \"This is sample reply\"\n 1 Create Data Space instances for the other ODS applications by clicking on the \"My....\" tabs which indicate each ODS Data Space\n 1 Proceed to experiment with the SPARQL queries below.\n\n---++++SPARQL Query Interfaces\n\nThe SPARQL Sample queries can be executed using Virtuoso's traditional console-based ISQL interface, the Web-based equivalent bundled with the Virtuoso Conductor Admin UI, or by using the iSPARQL Web Query Interface at http://myopenlink.net:8890/sparql_demo/ or exposed via the SPARQL endpoint at: http://myopenlink.net:8890/sparql/ . Of course you can also use the SPARQL Protocol to invoke these queries over HTTP using the SPARQL Query Endpoint at: http://myopenlink.net:8890/sparql/.\n\n*Note*: If you are using SQL-based Data Access methods such as ISQL, ODBC, JDBC, ADO.NET, or XMLA , you must prepend each query with sparql which is the convention required for executing SPARQL via Virtuoso SQL. Also do not forget to terminate your queries with semicolons (;) when using the ISQL interface in console mode.\n\n---++++Query Samples\n\nNote: Default Graph URI value used in the queries below is: http://myopenlink.net/dataspace\n\n * To return a list of all Classes \n\nPREFIX rdf: \nPREFIX sioc: \nSELECT distinct ?cls\nWHERE { ?o rdf:type ?cls }\nLIMIT 10\n\n * To return all Spaces\n\nPREFIX sioc: \nPREFIX rdf: \nSELECT *\nWHERE \n {\n ?space rdf:type sioc:Space. \n optional { ?site sioc:name ?name }\n }\nLIMIT 10\n\n * To return a list of Predicates/Properties/Attributes\n\nPREFIX rdf: \nPREFIX sioc: \nPREFIX dct: \nPREFIX dcc: \nSELECT distinct ?Predicate\nWHERE { ?o ?Predicate ?s . }\nLIMIT 10\n\n * To list all posts title, author, reply and post date.\n\nPREFIX sioc: \nPREFIX rdfs: \nPREFIX dct: \nPREFIX dcc: \nSELECT *\nWHERE \n {\n optional { ?post dct:title ?post_title }.\n optional { ?post dcc:created ?post_date}.\n optional { ?post sioc:has_creator ?creator}.\n optional { ?creator rdfs:label ?post_author}.\n optional { ?post sioc:has_reply ?reply }.\n optional { ?post rdfs:seeAlso ?post_sioc }.\n }\nLIMIT 10\n\n * To list all blog data spaces which belongs to friends of ODS user _test1_\n\nPREFIX sioc: \nPREFIX sioct: \nPREFIX rdf: \nPREFIX foaf: \nSELECT ?n, ?knows, ?name\nWHERE \n {\n ?po sioc:account_of ?t .\n ?t rdf:type foaf:Person .\n ?t foaf:nick ?n filter regex ('test1', ?n) .\n ?t foaf:knows ?s .\n ?s foaf:nick ?knows .\n ?s foaf:holdsAccount ?xx .\n ?xx sioc:owner_of ?f .\n ?f a sioct:Weblog .\n optional{?f sioc:id ?name}. \n }\n\n * To list all posts from ODS user _test1_'s blogs\n\nPREFIX rdf: \nPREFIX sioc: \nPREFIX dct: \nPREFIX dcc: \nPREFIX sioct: \nSELECT ?post, ?title ?cr ?name\nWHERE \n {\n optional{ ?post dct:title ?title }.\n optional{ ?post dcc:created ?cr }.\n ?post sioc:has_container ?forum .\n ?forum rdf:type sioct:Weblog .\n ?forum ?has_member ?member .\n ?member sioc:id ?name filter regex (?name, 'test1') .\n }\n\n * Find all posts from _test1_'s blogs including post timestamps accurate to the second (as opposed to millisecond)\n\nPREFIX rdf: \nPREFIX sioc: \nPREFIX sioct: \nPREFIX xsd: \nPREFIX dct: \nPREFIX dcc: \nSELECT ?title ?cr ?forum \nWHERE \n {\n optional{?post dcc:created ?cr}.\n optional{?post dct:title ?title }.\n ?post sioc:has_container ?forum .\n ?forum rdf:type sioct:Weblog .\n ?forum ?has_member ?member .\n ?member sioc:name \"test1\" .\n filter (xsd:dateTime (?cr) > xsd:dateTime (\"2006-05-01T10:56:00Z\"))\n }\nORDER BY ?cr limit 10\n\n * To find all Data Spaces belonging to ODS member: _test1_\n\nPREFIX rdf: \nPREFIX rdfs: \nPREFIX sioc: \nSELECT DISTINCT ?u ?name ?group\nWHERE \n {\n ?x rdf:type sioc:User .\n ?x sioc:name ?name .\n ?u sioc:has_member ?x .\n { ?u sioc:id ?group } UNION\n { ?u sioc:description ?group } .\n FILTER REGEX(str(?name), \"^test1\")\n }\n\n * To find all Briefcase Data Spaces owned by friends of user _test1_:\n\nPREFIX sioc: \nPREFIX sioct: \nPREFIX rdf: \nPREFIX foaf: \nSELECT ?n, ?knows, ?name\nWHERE \n {\n ?po sioc:account_of ?t .\n ?t rdf:type foaf:Person .\n ?t foaf:nick ?n filter regex ('test1', ?n) .\n ?t foaf:knows ?s .\n ?s foaf:nick ?knows .\n ?s foaf:holdsAccount ?xx .\n ?xx sioc:owner_of ?f .\n ?f a sioct:Briefcase.\n optional{?f sioc:id ?name}. \n }\n\n * To find all ODS Data Spaces belonging to friends of user 'test1':\n\nPREFIX sioc: \nPREFIX sioct: \nPREFIX rdf: \nPREFIX foaf: \nSELECT ?n, ?knows, ?name\nWHERE \n {\n ?po sioc:account_of ?t .\n ?t rdf:type foaf:Person .\n ?t foaf:nick ?n filter regex ('test1', ?n) .\n ?t foaf:knows ?s .\n ?s foaf:nick ?knows .\n ?s foaf:holdsAccount ?xx .\n ?xx sioc:owner_of ?f .\n optional{?f sioc:id ?name}. \n }\n\n * To find all Feed subscriptions that have ODS member: 'test1'\n\nPREFIX rdf: \nPREFIX sioc: \nPREFIX sioct: \nSELECT *\nWHERE \n {\n ?f rdf:type sioct:SubscriptionList .\n optional{?f sioc:has_member ?m}.\n ?m sioc:id ?name filter regex(?name,'test1') \n }\n\n * To find all Feeds entries/posts/items for ODS member: 'test1':\n\ndefine input:inference \"http://myopenlink.net/dataspace\" \nPREFIX rdf: \nPREFIX sioc: \nPREFIX dct: \nPREFIX sioct: \nSELECT ?fname ?post ?title\nWHERE \n { \n ?forum rdf:type sioct:SubscriptionList .\n ?forum sioc:id ?fname .\n ?forum ?has_member ?member filter regex (?member, \"test1\").\n optional{?forum sioc:parent_of ?parentf }.\n optional{?parentf sioc:container_of ?post} .\n optional{ ?post dct:title ?title }.\n }\n\n * To find all Feed Data Spaces hosted by the MyOpenLink.net service:\n\nPREFIX rdf: \nPREFIX sioct: \nSELECT *\nWHERE { ?f rdf:type sioct:SubscriptionList . }\n\n * To find all Blog Data Spaces hosted by the MyOpenLink.net service:\n\nPREFIX rdf: \nPREFIX sioct: \nSELECT *\nWHERE { ?f rdf:type sioct:Weblog. }\n\n * To find all Wiki Data Spaces hosted by the MyOpenLink.net service:\n\nPREFIX rdf: \nPREFIX sioct: \nSELECT *\nWHERE { ?f rdf:type sioct:Wiki .}\n\n * To find all Wiki Data Spaces and their respective owners:\n\nPREFIX rdf: \nPREFIX sioc: \nPREFIX sioct: \nSELECT *\nWHERE \n {\n ?f rdf:type sioct:Wiki .\n ?f sioc:has_owner ?owner. \n ?owner sioc:id ?name .\n }\n\n * To find all ODS Wiki Data Spaces where instance name contains the string pattern: 'test'\n\nPREFIX rdf: \nPREFIX sioc: \nPREFIX sioct: \nSELECT *\nWHERE {\n ?f rdf:type sioct:Wiki .\n ?f sioc:id ?s.\n FILTER REGEX(str(?s), \"^test\")\n }\n\n * To find all Wiki articles created ODS member: 'test1'\n\ndefine input:inference \"http://myopenlink.net/dataspace\" \nPREFIX rdf: \nPREFIX sioc: \nPREFIX sioct: \nPREFIX dct: \nSELECT *\nWHERE \n {\n ?forum rdf:type sioct:Wiki .\n ?forum sioc:id ?forum_name.\n ?forum ?has_member ?member .\n ?member sioc:id \"test1\" .\n ?forum sioc:container_of ?post .\n optional{?post dct:title ?title}. \n }\n\n * To find all the Wiki articles associated with one or more conversations managed by newsgroup: oWiki-test1Wiki.\n\nPREFIX sioc: \nPREFIX rdf: \nPREFIX dct: \nPREFIX dcc: \nPREFIX sioct: \nSELECT ?title ?created\nWHERE\n {\n graph \n {\n ?forum sioc:id \"oWiki-test1WikiEndpoint\" .\n ?forum rdf:type sioct:MessageBoard .\n ?forum sioc:container_of ?post .\n optional { ?post sioc:link ?link } .\n optional { ?post dct:title ?title}.\n optional { ?post dcc:created ?created }.\n }\n }\n\n * To find all discussions entries/posts across all conversation enabled ODS Data Spaces:\n\nPREFIX sioc: \nPREFIX rdf: \nPREFIX dct: \nPREFIX dcc: \nPREFIX sioct: \nSELECT ?title ?created\nWHERE {\n graph \n {\n ?forum rdf:type sioct:MessageBoard .\n ?post sioc:has_container ?forum . \n optional { ?post sioc:link ?link } .\n optional { ?post dct:title ?title}.\n optional { ?post dcc:created ?created }.\n }\n }\nORDER BY DESC (?created)\nLIMIT 10\n\n * To find all Photo Gallery Data Spaces hosted by the MyOpenLink.net service:\n\nPREFIX rdf: \nPREFIX sioct: \nSELECT *\nWHERE { ?forum rdf:type sioct:ImageGallery . }\n\n\n---+++Learn More \n * [[ODSSIOCRef][ODS SIOC reference]]\n * [[ODSAtomOWLRef][Query ODS Data Spaces using SPARQL and Atom OWL Ontology]]\n * [[ODSSKOSRef][Query ODS Data Spaces using SPARQL and SKOS Ontology]]\n * [[ODSFOAFRef][Query ODS Data Spaces using SPARQL and FOAF Ontology]]\n * [[ODSAnnoteaRef][Query ODS Data Spaces using SPARQL and Annotea Ontology]]\n * [[http://virtuoso.openlinksw.com/wiki/main/Main/NorthWindREF][Northwind SPARQL Reference]]\n * [[http://virtuoso.openlinksw.com/wiki/main/Main/SIOCRefTutorial][Query Virtuoso Tutorials using SPARQL]]\n * [[http://virtuoso.openlinksw.com/wiki/main/Main/SIOCRefDocs][Query Virtuoso Documentation using SPARQL]]\n * [[http://virtuoso.openlinksw.com/wiki/main/Main/VOS/WordPressSIOCRef][WordPress SIOC Reference]]\n * [[http://virtuoso.openlinksw.com/wiki/main/Main/VOS/MediaWikiSIOCRef][MedaWiki SIOC Reference]]\n * [[http://virtuoso.openlinksw.com/wiki/main/Main/VOS/PHPBB3SIOCRef][PHPBB SIOC Reference]]\n * [[http://virtuoso.openlinksw.com/wiki/main/Main/VOS/DrupalSIOCRef][Drupal SIOC Reference]]\n\nCategoryWebSite CategoryVirtuoso CategoryOpenSource CategoryVOS CategorySPARQL CategoryRDF CategoryODS CategoryDocumentation" . . "VOSODSSparqlSamples" . . . . . . . . . . . .