{"id":1170,"date":"2010-11-29T14:06:36","date_gmt":"2010-11-29T18:06:36","guid":{"rendered":"http:\/\/fgiasson.com\/blog\/?p=1170"},"modified":"2011-09-17T10:04:37","modified_gmt":"2011-09-17T14:04:37","slug":"getting-data-out-of-mypeg-ca-using-structwsf-endpoints","status":"publish","type":"post","link":"https:\/\/fgiasson.com\/blog\/index.php\/2010\/11\/29\/getting-data-out-of-mypeg-ca-using-structwsf-endpoints\/","title":{"rendered":"Getting Data Out of MyPeg.ca using structWSF Endpoints"},"content":{"rendered":"<table>\n<tbody>\n<tr>\n<td>A few weeks ago I presented the new <a href=\"..\/..\/..\/..\/..\/index.php\/2010\/11\/08\/mypeg-ca-a-community-indicators-web-portal-using-semantic-web-technologies\/\">MyPeg.ca community indicators web portal for Winnipeg\u00e2\u20ac\u2122s citizens<\/a>. I explained how in <a href=\"http:\/\/www.mypeg.ca\/\">MyPeg.ca<\/a> we leverage <a href=\"http:\/\/structureddynamics.com\/\">Structured Dynamics<\/a>\u00e2\u20ac\u2122 semantic technologies stack (<em>aka<\/em>The Semantic Muffin). Today\u00e2\u20ac\u2122s blog post explains one facet of the project that shows how external agents (people, services, software, etc.) can interact with the system\u00e2\u20ac\u2122s indicator datasets using the structWSF web service endpoints.Since this post focuses only on data export, I suggest you read the <a href=\"http:\/\/techwiki.openstructs.org\/index.php\/StructWSF_Web_Services_Tutorial\">structWSF Web Services Tutorial<\/a> for a complete overview of how the endpoints architecture works.<\/td>\n<td valign=\"top\">\n<p style=\"text-align: center;\"><a href=\"https:\/\/fgiasson.com\/blog\/wp-content\/uploads\/2010\/11\/old-factory.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-1186  aligncenter\" title=\"old-factory\" src=\"https:\/\/fgiasson.com\/blog\/wp-content\/uploads\/2010\/11\/old-factory-199x300.jpg\" alt=\"Merging Pipes\" width=\"199\" height=\"300\" srcset=\"https:\/\/fgiasson.com\/blog\/wp-content\/uploads\/2010\/11\/old-factory-199x300.jpg 199w, https:\/\/fgiasson.com\/blog\/wp-content\/uploads\/2010\/11\/old-factory.jpg 531w\" sizes=\"auto, (max-width: 199px) 100vw, 199px\" \/><\/a><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Two Main structWSF Characteristics: Accessibility &amp; Management<\/h3>\n<p><a href=\"http:\/\/openstructs.org\/structwsf\">structWSF<\/a> is a set of 22 web service endpoints that lets you integrate data from different sources, manage that integrated data, and publish it via different communication channels such as web pages, software applications, etc.<\/p>\n<p>Obviously, the main characteristic of this framework is that everything is a web service. This means that all functionality of the system can be accessed from anywhere on the Internet. However, this doesn\u00e2\u20ac\u2122t mean that everything is open like a snack-bar. In fact, there are two levels of accessibility: (1) access to the web service endpoint\u00e2\u20ac\u2122s URL, and (2) access to the content of datasets hosted on structWSF. Depending on the usecase, people could restrict the direct access to the web service endpoint(s) by properly configuring their web server, others could choose to let anyone access the endpoints, but would restrict the access to the dataset(s) hosted by structWSF. In case of MyPeg.ca, the sponsor chose to open the access to their web service endpoints and datasets.<\/p>\n<p>Just by surfing on the MyPeg.ca portal, you are already leveraging these endpoints in multiple different ways. First, each time you generate a <a href=\"http:\/\/www.mypeg.ca\/conStruct\/browse\/\">browse<\/a> or a <a href=\"http:\/\/www.mypeg.ca\/conStruct\/search\/?query=poverty\">search<\/a> Web page, you are telling the web server to send multiple queries to different endpoints; then the web page\u00e2\u20ac\u2122s content will be populated with that information and presented to you. But, each time you click on an <a href=\"http:\/\/www.mypeg.ca\/explorer\">explorer<\/a> node, your web browser is also sending queries to exactly the same web service endpoints. So, in one case a PHP script acts to query the endpoints; and, in other cases, a Flash <a href=\"http:\/\/openstructs.org\/semantic-components\">Semantic Component<\/a> does. Depending, all structWSF data can be accessed from quite different environments.<\/p>\n<p>The other main characteristic of structWSF is that any kind of data can be imported in, and exported out, of the system. structWSF leverages RDF (Resource Description Framework) as the canonical data format that can be used to express any other formats. It is because of the usage of RDF that structWSF can act as an effective <a href=\"http:\/\/en.wikipedia.org\/wiki\/Extract,_transform,_load\">ETL<\/a> (Extract, transform, load) system. Depending on the web service endpoint, the output formats currently supported by most of the endpoints are:<\/p>\n<ul>\n<li>text\/xml (<a href=\"http:\/\/techwiki.openstructs.org\/index.php\/StructXML\">structXML<\/a>)<\/li>\n<li>application\/json (<a href=\"http:\/\/techwiki.openstructs.org\/index.php\/StructXML\">structXML<\/a> in JSON)<\/li>\n<li>application\/iron+json (<a href=\"http:\/\/techwiki.openstructs.org\/index.php\/Instance_Record_and_Object_Notation_%28irON%29_Specification#SUB-PART_2:_irJSON_PROFILE\">irJSON<\/a>)<\/li>\n<li>application\/rdf+xml (<a href=\"http:\/\/www.w3.org\/TR\/REC-rdf-syntax\/\">RDF\/XML<\/a>)<\/li>\n<li>application\/rdf+n3 (<a href=\"http:\/\/www.w3.org\/DesignIssues\/Notation3.html\">RDF\/N3<\/a>)<\/li>\n<\/ul>\n<p>But the architecture of the web service endpoints can easily accommodate other formats if needed for a specific usecase.<\/p>\n<h3>Getting Data Out Of MyPeg.ca<\/h3>\n<p>Now, how can you get data out of MyPeg.ca? There are really two methods. This blog post discusses the <em>CRUD: Read<\/em>, <em>Browse<\/em> and <em>Search<\/em> web service endpoints. In my next blog post, I will focus on using the SPARQL web service endpoint to do the same.<\/p>\n<p>All of the query examples in this blog post will use a tool called <a href=\"http:\/\/curl.haxx.se\/\">Curl<\/a> to send the queries and to get back the resultsets. I encourage you to download and use that tool to test these endpoints and to gain a feeling for how it works. Also note that only the first record of each resultset is recorded below (of course, the actual results include all records).<\/p>\n<h3>Browse<\/h3>\n<p>The <a href=\"http:\/\/techwiki.openstructs.org\/index.php\/Browse\">Browse web service endpoint<\/a> is used to return lists of records. These records can also be filtered according to their provenance (dataset), type and the attributes that describe them. Now, let\u00e2\u20ac\u2122s see how you can use this web service to get data out of MyPeg.ca.<\/p>\n<p>First, there are three datasets available to the public:<\/p>\n<ol>\n<li>Well-being Indicators (http:\/\/www.mypeg.ca\/wsf\/datasets\/258\/)<\/li>\n<li>Stories (http:\/\/www.mypeg.ca\/wsf\/datasets\/272\/)<\/li>\n<li>PEG Framework (http:\/\/www.mypeg.ca\/wsf\/datasets\/249\/)<\/li>\n<\/ol>\n<p>The resultsets can be serialized using one of these four different formats:<\/p>\n<ul>\n<li>text\/xml (structXML)<\/li>\n<li>application\/json (structXML in JSON)<\/li>\n<li>application\/rdf+xml (RDF\/XML)<\/li>\n<li>application\/rdf+n3 (RDF\/N3)<\/li>\n<\/ul>\n<p>Note: if one of your desired formats is not directly available at the endpoint level, you can always use one of the converter web service endpoints such as: <a href=\"http:\/\/techwiki.openstructs.org\/index.php\/Converter:_commON\">commON<\/a>, <a href=\"http:\/\/techwiki.openstructs.org\/index.php\/Converter:_irJSON\">irJSON<\/a> or <a href=\"http:\/\/techwiki.openstructs.org\/index.php\/Converter:_TSV\/CSV\">TSV\/CSV<\/a>.<\/p>\n<h4>Get the first 10 results of the Stories dataset in structXML<\/h4>\n<p>Query:<\/p>\n<p>[cc lang=&#8217;text&#8217; line_numbers=&#8217;false&#8217;]curl -H &#8220;Accept: text\/xml&#8221; &#8220;http:\/\/www.mypeg.ca\/ws\/browse\/&#8221; -d &#8220;attributes=all&amp;types=all&amp;datasets=http%3A%2F%2Fwww.mypeg.ca%2Fwsf%2Fdatasets%2F272%2F&amp;items=10&amp;page=0&amp;inference=on&amp;include_aggregates=true&#8221;[\/cc]<\/p>\n<p>StructXML resultset:<\/p>\n<p>[cc lang=&#8217;xml&#8217; line_numbers=&#8217;false&#8217; escaped=&#8217;true&#8217;]<\/p>\n<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br \/>\n&lt;resultset&gt;<br \/>\n&lt;prefix entity=&#8221;owl&#8221; uri=&#8221;http:\/\/www.w3.org\/2002\/07\/owl#&#8221;\/&gt;<br \/>\n&lt;prefix entity=&#8221;rdf&#8221; uri=&#8221;http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#&#8221;\/&gt;<br \/>\n&lt;prefix entity=&#8221;rdfs&#8221; uri=&#8221;http:\/\/www.w3.org\/2000\/01\/rdf-schema#&#8221;\/&gt;<br \/>\n&lt;prefix entity=&#8221;wsf&#8221; uri=&#8221;http:\/\/purl.org\/ontology\/wsf#&#8221;\/&gt;<br \/>\n&lt;subject type=&#8221;http:\/\/purl.org\/ontology\/muni#Story&#8221; uri=&#8221;http:\/\/www.mypeg.ca\/wsf\/datasets\/272\/resource\/AgeOpportunity&#8221;&gt;<br \/>\n&lt;predicate type=&#8221;http:\/\/purl.org\/dc\/terms\/isPartOf&#8221;&gt;<br \/>\n&lt;object type=&#8221;http:\/\/rdfs.org\/ns\/void#Dataset&#8221; uri=&#8221;http:\/\/www.mypeg.ca\/wsf\/datasets\/272\/&#8221;\/&gt;<br \/>\n&lt;\/predicate&gt;<br \/>\n&lt;predicate type=&#8221;http:\/\/purl.org\/ontology\/iron#prefLabel&#8221;&gt;<br \/>\n&lt;object type=&#8221;rdfs:Literal&#8221;&gt;Age &amp;amp; Opportunity&lt;\/object&gt;<br \/>\n&lt;\/predicate&gt;<br \/>\n&lt;predicate type=&#8221;http:\/\/purl.org\/dc\/terms\/created&#8221;&gt;<br \/>\n&lt;object type=&#8221;rdfs:Literal&#8221;&gt;2010-10-28T19:38:58+00:00&lt;\/object&gt;<br \/>\n&lt;\/predicate&gt;<br \/>\n&lt;predicate type=&#8221;http:\/\/purl.org\/ontology\/bibo\/abstract&#8221;&gt;<br \/>\n&lt;object type=&#8221;rdfs:Literal&#8221;&gt;Amanda Macrae, Deborah Lorteau and Stacey Miller work for Age and Opportunity.<br \/>\nThe majority of clients are older adults living at lower socio economic status. When addressing the housing issue they say, &#8220;In a nutshell, it&#8217;s dire.&#8221; There is simply not enou&#8230;&lt;\/object&gt;<br \/>\n&lt;\/predicate&gt;<br \/>\n&lt;predicate type=&#8221;http:\/\/purl.org\/ontology\/peg#interviewee&#8221;&gt;<br \/>\n&lt;object type=&#8221;rdfs:Literal&#8221;&gt;Amanda Macrae, Deborah Lorteau, Stacey Miller&lt;\/object&gt;<br \/>\n&lt;\/predicate&gt;<br \/>\n&lt;predicate type=&#8221;http:\/\/purl.org\/ontology\/peg#interviewer&#8221;&gt;<br \/>\n&lt;object type=&#8221;rdfs:Literal&#8221;&gt;Molly Johnson&lt;\/object&gt;<br \/>\n&lt;\/predicate&gt;<br \/>\n&lt;predicate type=&#8221;http:\/\/purl.org\/ontology\/peg#storyRelatedAgencyProgram&#8221;&gt;<br \/>\n&lt;object type=&#8221;rdfs:Literal&#8221;&gt;Age &amp;amp; Opportunity&lt;\/object&gt;<br \/>\n&lt;\/predicate&gt;<br \/>\n&lt;predicate type=&#8221;http:\/\/purl.org\/ontology\/sco#storyAnnotatedTextUri&#8221;&gt;<br \/>\n&lt;object&gt;http:\/\/www.mypeg.ca\/scones\/AgeOpportunity.xml&lt;\/object&gt;<br \/>\n&lt;\/predicate&gt;<br \/>\n&lt;predicate type=&#8221;http:\/\/purl.org\/ontology\/sco#storyTextUri&#8221;&gt;<br \/>\n&lt;object type=&#8221;rdfs:Literal&#8221;&gt;http:\/\/www.mypeg.ca\/scones\/AgeOpportunity.txt&lt;\/object&gt;<br \/>\n&lt;\/predicate&gt;<br \/>\n&lt;\/subject&gt;<br \/>\n&lt;\/resultset&gt;<\/p>\n<p>[\/cc]<\/p>\n<h4>Get the 10 first results from all datasets that are records of type Neighborhoods in RDF\/XML<\/h4>\n<p>Query:<\/p>\n<p>[cc lang=&#8217;text&#8217; line_numbers=&#8217;false&#8217;]curl -H &#8220;Accept: application\/rdf+xml &#8221; &#8220;http:\/\/www.mypeg.ca\/ws\/browse\/&#8221; -d &#8220;attributes=all&amp; type=http%3A%2F%2Fpurl.org%2Fontology%2Fpeg%23Neighborhood &amp;datasets=all&amp;items=10&amp;page=0&amp;inference=on&amp;include_aggregates=true&#8221;[\/cc]<\/p>\n<p>RDF\/XML resultset:<\/p>\n<p>[cc lang=&#8217;xml&#8217; line_numbers=&#8217;false&#8217; escaped=&#8217;true&#8217;]<\/p>\n<p>&lt;?xml version=&#8221;1.0&#8243;?&gt;<br \/>\n&lt;rdf:RDF\u00c2\u00a0 xmlns:owl=&#8221;http:\/\/www.w3.org\/2002\/07\/owl#&#8221; xmlns:rdf=&#8221;http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#&#8221; xmlns:rdfs=&#8221;http:\/\/www.w3.org\/2000\/01\/rdf-schema#&#8221; xmlns:wsf=&#8221;http:\/\/purl.org\/ontology\/wsf#&#8221; xmlns:ns0=&#8221;http:\/\/purl.org\/ontology\/peg#&#8221; xmlns:ns1=&#8221;http:\/\/purl.org\/dc\/terms\/&#8221; xmlns:ns2=&#8221;http:\/\/purl.org\/ontology\/iron#&#8221; xmlns:ns3=&#8221;&#8221; xmlns:ns4=&#8221;http:\/\/purl.org\/dc\/elements\/1.1\/&#8221; xmlns:ns5=&#8221;http:\/\/purl.org\/ontology\/aggregate#&#8221;&gt;<\/p>\n<p>&lt;ns0:Component rdf:about=&#8221;http:\/\/purl.org\/ontology\/peg\/framework#Safety&#8221;&gt;<br \/>\n&lt;ns1:isPartOf rdf:resource=&#8221;http:\/\/www.mypeg.ca\/wsf\/datasets\/249\/&#8221; \/&gt;<br \/>\n&lt;ns2:prefLabel&gt;Safety&lt;\/ns2:prefLabel&gt;<br \/>\n&lt;ns2:altLabel&gt;safety&lt;\/ns2:altLabel&gt;<br \/>\n&lt;ns3:&gt;safety&lt;\/ns3:&gt;<br \/>\n&lt;ns4:description&gt;Safety is the state of being &#8220;safe&#8221;, the condition of being protected against physical, social, spiritual, financial, political, emotional, occupational, psychological, educational or other types or consequences of failure, damage, error, accidents, harm or any other event which could be considered non-desirable.&lt;\/ns4:description&gt;<br \/>\n&lt;rdfs:comment&gt;Includes the idea of safety prevention&lt;\/rdfs:comment&gt;<br \/>\n&lt;rdfs:seeAlso&gt;http:\/\/en.wikipedia.org\/wiki\/Safety&lt;\/rdfs:seeAlso&gt;<br \/>\n&lt;ns0:hasIndicator rdf:resource=&#8221;http:\/\/purl.org\/ontology\/peg\/framework#HouseholdIncome&#8221; \/&gt;<br \/>\n&lt;ns0:hasIndicator rdf:resource=&#8221;http:\/\/purl.org\/ontology\/peg\/framework#LowIncomeCutOffAfterTax&#8221; \/&gt;<br \/>\n&lt;ns0:hasIndicator rdf:resource=&#8221;http:\/\/purl.org\/ontology\/peg\/framework#MarketBasketMeasure&#8221; \/&gt;<br \/>\n&lt;ns0:hasIndicator rdf:resource=&#8221;http:\/\/purl.org\/ontology\/peg\/framework#ParticipationInSportsAndRecreation&#8221; \/&gt;<br \/>\n&lt;ns0:hasIndicator rdf:resource=&#8221;http:\/\/purl.org\/ontology\/peg\/framework#MaternalSocialIsolation&#8221; \/&gt;<br \/>\n&lt;ns0:hasIndicator rdf:resource=&#8221;http:\/\/purl.org\/ontology\/peg\/framework#PersonalSafety&#8221; \/&gt;<br \/>\n&lt;ns0:hasIndicator rdf:resource=&#8221;http:\/\/purl.org\/ontology\/peg\/framework#EarlyDevelopmentInstrument&#8221; \/&gt;<br \/>\n&lt;ns0:hasIndicator rdf:resource=&#8221;http:\/\/purl.org\/ontology\/peg\/framework#HighSchoolGraduationRate&#8221; \/&gt;<br \/>\n&lt;ns0:hasIndicator rdf:resource=&#8221;http:\/\/purl.org\/ontology\/peg\/framework#LongTermUnemployment&#8221; \/&gt;<br \/>\n&lt;ns0:hasIndicator rdf:resource=&#8221;http:\/\/purl.org\/ontology\/peg\/framework#TeenageBirths&#8221; \/&gt;<br \/>\n&lt;ns0:isComponentOf rdf:resource=&#8221;http:\/\/purl.org\/ontology\/peg\/framework#BasicNeeds&#8221; \/&gt;<br \/>\n&lt;ns0:isComponentOf rdf:resource=&#8221;http:\/\/purl.org\/ontology\/peg\/framework#Poverty&#8221; \/&gt;<br \/>\n&lt;\/ns0:Component&gt;<br \/>\n&lt;\/rdf:RDF&gt;<\/p>\n<p>[\/cc]<\/p>\n<h3>Search<\/h3>\n<p>The <a href=\"http:\/\/techwiki.openstructs.org\/index.php\/Search\">Search web service endpoint<\/a> is also used to return lists of records. These records should match a search string and can also be filtered according to their provenance (dataset), type and the attributes that describe them.<\/p>\n<p>The same mime types and datasets as the ones for the Browse web service are available for the Search endpoint.<\/p>\n<h4>Searching for records with the keyword \u00e2\u20ac\u0153poverty\u00e2\u20ac\u009d and get resultsets in RDF\/N3<\/h4>\n<p>Query:<\/p>\n<p>[cc lang=&#8217;text&#8217; line_numbers=&#8217;false&#8217;]curl -H &#8220;Accept: application\/rdf+n3&#8221; &#8220;http:\/\/www.mypeg.ca\/ws\/search\/&#8221; -d &#8220;query=poverty&amp;datasets=all&amp;items=10&amp;page=0&amp;inference=on&amp;include_aggregates=true&#8221;[\/cc]<\/p>\n<p>RDF\/N3 resultset:<\/p>\n<p>[cc lang=&#8217;text&#8217; line_numbers=&#8217;false&#8217; escaped=&#8217;true&#8217;]<\/p>\n<p>@prefix rdf: &lt;http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#&gt; .<br \/>\n@prefix wsf: &lt;http:\/\/purl.org\/ontology\/wsf#&gt; .<\/p>\n<p>&lt;http:\/\/purl.org\/ontology\/peg\/framework#Poverty&gt; a &lt;http:\/\/purl.org\/ontology\/peg#CrossCuttingIssue&gt; ;<br \/>\n&lt;http:\/\/purl.org\/dc\/terms\/isPartOf&gt; &lt;http:\/\/www.mypeg.ca\/wsf\/datasets\/249\/&gt; ;<br \/>\n&lt;http:\/\/purl.org\/ontology\/iron#prefLabel&gt; &#8220;&#8221;&#8221;Poverty&#8221;&#8221;&#8221; ;<br \/>\n&lt;http:\/\/purl.org\/dc\/elements\/1.1\/description&gt; &#8220;&#8221;&#8221;Poverty is not having the sufficient resources, capabilities, choices, security and power necessary to enjoy an adequate standard of living.\u00c2\u00a0 Poverty includes much more than a lack of money.\u00c2\u00a0 It includes being excluded from ordinary living patterns, customs and activities.\u00c2\u00a0 Consequently, people living in poverty are often unable to participate fully in their communities or to reach their full potential.&#8221;&#8221;&#8221; ;<br \/>\n&lt;http:\/\/www.w3.org\/2000\/01\/rdf-schema#seeAlso&gt; &#8220;&#8221;&#8221;http:\/\/en.wikipedia.org\/wiki\/Poverty&#8221;&#8221;&#8221; .<\/p>\n<p>[\/cc]<\/p>\n<h3>CRUD: Read<\/h3>\n<p>The Browse and Search web service endpoints are really used to find lists of records according to some provided criteria. However, the complete description of these records is not returned by these endpoints, but only the information necessary to create the proper list to display to users in a user interface. So, to get the complete description of a record (or multiples thereof), you have to use the <a href=\"http:\/\/techwiki.openstructs.org\/index.php\/CRUD:_Read\">CRUD: Read web service endpoint<\/a>. Also, sometimes you may get a reference to a record hosted on a structWSF node, then CRUD: Read is the way to get its full description.<\/p>\n<h4>Get the full description of the Ida story in irJSON<\/h4>\n<p>Query:<\/p>\n<p>[cc lang=&#8217;text&#8217; line_numbers=&#8217;false&#8217;]curl -H &#8220;Accept: application\/iron+json&#8221; &#8220;http:\/\/www.mypeg.ca\/ws\/crud\/read\/?uri=http%3A%2F%2Fwww.mypeg.ca%2Fwsf%2Fdatasets%2F272%2Fresource%2FIda&amp;dataset=http%3A%2F%2Fwww.mypeg.ca%2Fwsf%2Fdatasets%2F272%2F&amp;include_reification=true&amp;include_linksback=false[\/cc]<\/p>\n<p>irJSON resulset:<\/p>\n<p>[cc lang=&#8217;javascript&#8217; line_numbers=&#8217;false&#8217; escaped=&#8217;true&#8217;]<\/p>\n<p>{<br \/>\n&#8220;dataset&#8221;: {<br \/>\n&#8220;linkage&#8221;: [<br \/>\n{<br \/>\n&#8220;linkedType&#8221;: &#8220;application\/rdf+xml&#8221;,<br \/>\n&#8220;attributeList&#8221;: {<br \/>\n&#8220;created&#8221;: {<br \/>\n&#8220;mapTo&#8221;: &#8220;http:\/\/purl.org\/dc\/terms\/created&#8221;<br \/>\n},<br \/>\n&#8220;isAbout&#8221;: {<br \/>\n&#8220;mapTo&#8221;: &#8220;http:\/\/umbel.org\/umbel#isAbout&#8221;<br \/>\n},<br \/>\n&#8220;prefLabel&#8221;: {<br \/>\n&#8220;mapTo&#8221;: &#8220;http:\/\/purl.org\/ontology\/iron#prefLabel&#8221;<br \/>\n},<br \/>\n&#8220;interviewee&#8221;: {<br \/>\n&#8220;mapTo&#8221;: &#8220;http:\/\/purl.org\/ontology\/peg#interviewee&#8221;<br \/>\n},<br \/>\n&#8220;interviewer&#8221;: {<br \/>\n&#8220;mapTo&#8221;: &#8220;http:\/\/purl.org\/ontology\/peg#interviewer&#8221;<br \/>\n},<br \/>\n&#8220;abstract&#8221;: {<br \/>\n&#8220;mapTo&#8221;: &#8220;http:\/\/purl.org\/ontology\/bibo\/abstract&#8221;<br \/>\n},<br \/>\n&#8220;storyVideoAudio&#8221;: {<br \/>\n&#8220;mapTo&#8221;: &#8220;http:\/\/purl.org\/ontology\/peg#storyVideoAudio&#8221;<br \/>\n},<br \/>\n&#8220;storyAnnotatedTextUri&#8221;: {<br \/>\n&#8220;mapTo&#8221;: &#8220;http:\/\/purl.org\/ontology\/sco#storyAnnotatedTextUri&#8221;<br \/>\n},<br \/>\n&#8220;storyTextUri&#8221;: {<br \/>\n&#8220;mapTo&#8221;: &#8220;http:\/\/purl.org\/ontology\/sco#storyTextUri&#8221;<br \/>\n}<br \/>\n},<br \/>\n&#8220;typeList&#8221;: {<br \/>\n&#8220;Story&#8221;: {<br \/>\n&#8220;mapTo&#8221;: &#8220;http:\/\/purl.org\/ontology\/muni#Story&#8221;<br \/>\n}<br \/>\n}<br \/>\n}<br \/>\n]},<br \/>\n&#8220;recordList&#8221;: [<br \/>\n{<br \/>\n&#8220;id&#8221;: &#8220;http:\/\/www.mypeg.ca\/wsf\/datasets\/272\/resource\/Ida&#8221;,<br \/>\n&#8220;type&#8221;: &#8220;Story&#8221;,<br \/>\n&#8220;created&#8221;: &#8220;2010-10-28T18:11:27+00:00&#8221;,<br \/>\n&#8220;isAbout&#8221;: [<br \/>\n{<br \/>\n&#8220;ref&#8221;: &#8220;@@http:\/\/purl.org\/ontology\/peg\/framework#EducationAndLearning&#8221;<br \/>\n},<br \/>\n{<br \/>\n&#8220;ref&#8221;: &#8220;@@http:\/\/purl.org\/ontology\/peg\/framework#Health&#8221;<br \/>\n},<br \/>\n{<br \/>\n&#8220;ref&#8221;: &#8220;@@http:\/\/purl.org\/ontology\/peg\/framework#Program&#8221;<br \/>\n},<br \/>\n{<br \/>\n&#8220;ref&#8221;: &#8220;@@http:\/\/purl.org\/ontology\/peg\/framework#Income&#8221;<br \/>\n},<br \/>\n{<br \/>\n&#8220;ref&#8221;: &#8220;@@http:\/\/purl.org\/ontology\/peg\/framework#Poverty&#8221;<br \/>\n}\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 ],<br \/>\n&#8220;prefLabel&#8221;: &#8220;Ida&#8221;,<br \/>\n&#8220;interviewee&#8221;: &#8220;Ida&#8221;,<br \/>\n&#8220;interviewer&#8221;: &#8220;Christa Rust&#8221;,<br \/>\n&#8220;abstract&#8221;: &#8220;&#8216;Poverty is earning just enough to get by; never having money for extras.&#8217;\\n\\nIda is the mother of two grown children, eight years apart.\u00c2\u00a0 She lives in a small bachelor suite, which costs her $428 per month, or 62% of her income.\u00c2\u00a0 She volunteers twice a we&#8230;&#8221;,<br \/>\n&#8220;storyVideoAudio&#8221;: &#8220;http:\/\/www.youtube.com\/v\/0zIqtYhiHfM&#8221;,<br \/>\n&#8220;storyAnnotatedTextUri&#8221;: &#8220;http:\/\/www.mypeg.ca\/scones\/Ida.xml&#8221;,<br \/>\n&#8220;storyTextUri&#8221;: &#8220;http:\/\/www.mypeg.ca\/scones\/Ida.txt&#8221;<br \/>\n}<br \/>\n]<br \/>\n}<\/p>\n<p>[\/cc]<\/p>\n<h4>Get Well-Being record description with linkbacks in RDF+N3<\/h4>\n<p>The characteristic of this query is that I enabled the \u00e2\u20ac\u0153include_linksback\u00e2\u20ac\u009d parameter. This returns a reference to all the records, in the datasets hosted on the structWSF node, that refers to that target record.<\/p>\n<p>Query:<\/p>\n<p>[cc lang=&#8217;text&#8217; line_numbers=&#8217;false&#8217;]curl -H &#8220;Accept: application\/rdf+n3&#8221; &#8220;http:\/\/www.mypeg.ca\/ws\/crud\/read\/?uri=http%3A%2F%2Fpurl.org%2Fontology%2Fpeg%2Fframework%23WellBeing&amp;datast=http%3A%2F%2Fwww.mypeg.ca%2Fwsf%2Fdatasets%2F249%2F&amp;registered_ip=self%3A%3A0&amp;include_reification=true&amp;include_linksback=true&#8221;[\/cc]<\/p>\n<p>RDF+N3 resultset:<\/p>\n<p>[cc lang=&#8217;text&#8217; line_numbers=&#8217;false&#8217; escaped=&#8217;true&#8217;]<\/p>\n<p>@prefix rdf: &lt;http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#&gt; .<\/p>\n<p>&lt;http:\/\/purl.org\/ontology\/peg\/framework#WellBeing&gt; a &lt;http:\/\/purl.org\/ontology\/peg\/framework#WellBeing&gt; ;<br \/>\n&lt;http:\/\/purl.org\/ontology\/iron#prefLabel&gt; &#8220;&#8221;&#8221;Well-being&#8221;&#8221;&#8221; ;<br \/>\n&lt;http:\/\/purl.org\/dc\/elements\/1.1\/description&gt; &#8220;&#8221;&#8221;Well-being refers to the general quality of life experienced by individuals and communities. The elements of wellbeing include: the ability to meet basic needs, the economy, health, the built environment, governance, education and learning, the natural environment, and social vitality.&#8221;&#8221;&#8221; ;<br \/>\n&lt;http:\/\/purl.org\/ontology\/sco#displayComponent&gt; &lt;http:\/\/purl.org\/ontology\/sco#sRelationBrowser&gt; .<\/p>\n<p>&lt;http:\/\/purl.org\/ontology\/peg\/framework#WellBeing&gt; a &lt;http:\/\/www.w3.org\/2002\/07\/owl#Thing&gt; ;<br \/>\n&lt;http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#type&gt; &lt;http:\/\/purl.org\/ontology\/peg\/framework#WellBeing&gt; .<\/p>\n<p>&lt;http:\/\/purl.org\/ontology\/peg\/framework#Economy&gt; a &lt;http:\/\/www.w3.org\/2002\/07\/owl#Thing&gt; ;<br \/>\n&lt;http:\/\/purl.org\/ontology\/peg#isThemeOf&gt; &lt;http:\/\/purl.org\/ontology\/peg\/framework#WellBeing&gt; .<\/p>\n<p>&lt;http:\/\/purl.org\/ontology\/peg\/framework#Governance&gt; a &lt;http:\/\/www.w3.org\/2002\/07\/owl#Thing&gt; ;<br \/>\n&lt;http:\/\/purl.org\/ontology\/peg#isThemeOf&gt; &lt;http:\/\/purl.org\/ontology\/peg\/framework#WellBeing&gt; .<\/p>\n<p>&lt;http:\/\/purl.org\/ontology\/peg\/framework#BuiltEnvironment&gt; a &lt;http:\/\/www.w3.org\/2002\/07\/owl#Thing&gt; ;<br \/>\n&lt;http:\/\/purl.org\/ontology\/peg#isThemeOf&gt; &lt;http:\/\/purl.org\/ontology\/peg\/framework#WellBeing&gt; .<\/p>\n<p>&lt;http:\/\/purl.org\/ontology\/peg\/framework#NaturalEnvironment&gt; a &lt;http:\/\/www.w3.org\/2002\/07\/owl#Thing&gt; ;<br \/>\n&lt;http:\/\/purl.org\/ontology\/peg#isThemeOf&gt; &lt;http:\/\/purl.org\/ontology\/peg\/framework#WellBeing&gt; .<\/p>\n<p>&lt;http:\/\/purl.org\/ontology\/peg\/framework#SocialVitality&gt; a &lt;http:\/\/www.w3.org\/2002\/07\/owl#Thing&gt; ;<br \/>\n&lt;http:\/\/purl.org\/ontology\/peg#isThemeOf&gt; &lt;http:\/\/purl.org\/ontology\/peg\/framework#WellBeing&gt; .<\/p>\n<p>&lt;http:\/\/purl.org\/ontology\/peg\/framework#BasicNeeds&gt; a &lt;http:\/\/www.w3.org\/2002\/07\/owl#Thing&gt; ;<br \/>\n&lt;http:\/\/purl.org\/ontology\/peg#isThemeOf&gt; &lt;http:\/\/purl.org\/ontology\/peg\/framework#WellBeing&gt; .<\/p>\n<p>&lt;http:\/\/purl.org\/ontology\/peg\/framework#EducationAndLearning&gt; a &lt;http:\/\/www.w3.org\/2002\/07\/owl#Thing&gt; ;<br \/>\n&lt;http:\/\/purl.org\/ontology\/peg#isThemeOf&gt; &lt;http:\/\/purl.org\/ontology\/peg\/framework#WellBeing&gt; .<\/p>\n<p>&lt;http:\/\/purl.org\/ontology\/peg\/framework#Health&gt; a &lt;http:\/\/www.w3.org\/2002\/07\/owl#Thing&gt; ;<br \/>\n&lt;http:\/\/purl.org\/ontology\/peg#isThemeOf&gt; &lt;http:\/\/purl.org\/ontology\/peg\/framework#WellBeing&gt; .<\/p>\n<p>[\/cc]<\/p>\n<h3>General Endpoint Parameters<\/h3>\n<p>The general parameters available for each of these web services is provided in their respective <a href=\"http:\/\/techwiki.openstructs.org\/\">TechWiki<\/a> documentation. For that detailed information, see the <a href=\"http:\/\/techwiki.openstructs.org\/index.php\/Browse\">Browse<\/a>, <a href=\"http:\/\/techwiki.openstructs.org\/index.php\/Search\">Search<\/a>, or <a href=\"http:\/\/techwiki.openstructs.org\/index.php\/CRUD:_Read\">CRUD: Read<\/a> articles.<\/p>\n<h3>Conclusion<\/h3>\n<p>As you can see, agents can get different kinds of data from the MyPeg.ca portal by querying a set of web service endpoints. This is one way to get data out of the system. These data can then be accessed for indexing in other systems, for direct use, or for dynamic applications like browsing the nodes in the <a href=\"http:\/\/www.mypeg.ca\/explorer\">explorer<\/a>.<\/p>\n<p>This is one of the ways to get data out of the system. A user can also export that same information from the Export features on the Browse, Search and Record View pages. Also, other methods will be explained in the next blog posts from this MyPeg.ca series.<\/p>\n<p>All in all, this shows how effective structWSF can be to integrate, manage and publish a wide range of data in different data formats. It also shows how completely different parts of your software architecture can leverage your information, the way you want, from anywhere on the Internet.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A few weeks ago I presented the new MyPeg.ca community indicators web portal for Winnipeg\u00e2\u20ac\u2122s citizens. I explained how in MyPeg.ca we leverage Structured Dynamics\u00e2\u20ac\u2122 semantic technologies stack (akaThe Semantic Muffin). Today\u00e2\u20ac\u2122s blog post explains one facet of the project that shows how external agents (people, services, software, etc.) can interact with the system\u00e2\u20ac\u2122s indicator [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[156,154,155,157,84,153],"tags":[166,163,167],"class_list":["post-1170","post","type-post","status-publish","format-standard","hentry","category-iron","category-osf-for-drupal","category-osf-web-services","category-osf-widgets","category-semantic-web","category-structured-dynamics","tag-mypeg","tag-structwsf-2","tag-web-services"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1170"}],"version-history":[{"count":27,"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1170\/revisions"}],"predecessor-version":[{"id":1196,"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1170\/revisions\/1196"}],"wp:attachment":[{"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}