You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by Guilherme Cavalcanti <an...@apache.org> on 2013/01/19 02:13:11 UTC
CMS diff: sparql_data_pt.mdtext
Clone URL (Committers only):
https://cms.apache.org/redirect?new=anonymous;action=diff;uri=http://jena.apache.org/tutorials%2Fsparql_data_pt.mdtext
Guilherme Cavalcanti
Index: trunk/content/tutorials/sparql_data_pt.mdtext
===================================================================
--- trunk/content/tutorials/sparql_data_pt.mdtext (revision 0)
+++ trunk/content/tutorials/sparql_data_pt.mdtext (working copy)
@@ -0,0 +1,102 @@
+Title: Tutorial SPARQL - Formato de Dados
+Notice: Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ .
+ http://www.apache.org/licenses/LICENSE-2.0
+ .
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+Primeiro, nós precisamos esclarecer quais dados estão sendo consultados. SPARQL consulta grafos RDF. Um grafo RDF é um conjunto de triplas (Jena chama os grafos de modelos e as triplas de sentenças porque assim eram chamadas quando a API foi elaborada inicialmente).
+
+É importante perceber que o que importa são as triplas, e não a serialização. A serialização é apenas uma maneira de escrever as triplas. RDF/XML é uma recomendação da W3C, mas isso pode dificultar a visão das triplas porque há múltiplas formas de codificar o mesmo grafo. Neste tutorial, usamos uma serialização mais parecida com triplas, chamada [Turtle](http://www.ilrt.bris.ac.uk/discovery/2004/01/turtle/) (veja também a linguagem N3 descrita pela [W3C semantic web primer](http://www.w3.org/2000/10/swap/Primer)).
+
+Nós vamos começar os dados em [vc-db-1.rdf](sparql_data/vc-db-1.rdf):
+este arquivo contém RDF para uma quantidade de descrições de vcards de pessoas. Vcards são descritos em
+[RFC2426](http://www.ietf.org/rfc/rfc2426.txt) e a tradução RDF é descrita na nota da W3C
+"[Representing vCard Objects in RDF/XML](http://www.w3.org/TR/vcard-rdf.html)".
+Nosso banco de dados exemplo apenas contém alguma informação sobre nomes.
+
+Graficamente, os dados se assemelham a:
+
+![Graph of the vCard database](/images/vc-db.png "Graph of the vCard database")
+
+Em triplas, devem se parecer com:
+
+ @prefix vCard: <http://www.w3.org/2001/vcard-rdf/3.0#> .
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+ @prefix : <#> .
+
+ <http://somewhere/MattJones/>
+ vCard:FN "Matt Jones" ;
+ vCard:N [ vCard:Family
+ "Jones" ;
+ vCard:Given
+ "Matthew"
+ ] .
+
+ <http://somewhere/RebeccaSmith/>
+ vCard:FN "Becky Smith" ;
+ vCard:N [ vCard:Family
+ "Smith" ;
+ vCard:Given
+ "Rebecca"
+ ] .
+
+ <http://somewhere/JohnSmith/>
+ vCard:FN "John Smith" ;
+ vCard:N [ vCard:Family
+ "Smith" ;
+ vCard:Given
+ "John"
+ ] .
+
+ <http://somewhere/SarahJones/>
+ vCard:FN "Sarah Jones" ;
+ vCard:N [ vCard:Family
+ "Jones" ;
+ vCard:Given
+ "Sarah"
+ ] .
+
+ou então mais explicitamente como triplas:
+
+ @prefix vCard: <http://www.w3.org/2001/vcard-rdf/3.0#> .
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+ <http://somewhere/MattJones/> vCard:FN "Matt Jones" .
+ <http://somewhere/MattJones/> vCard:N _:b0 .
+ _:b0 vCard:Family "Jones" .
+ _:b0 vCard:Given "Matthew" .
+
+
+ <http://somewhere/RebeccaSmith/> vCard:FN "Becky Smith" .
+ <http://somewhere/RebeccaSmith/> vCard:N _:b1 .
+ _:b1 vCard:Family "Smith" .
+ _:b1 vCard:Given "Rebecca" .
+
+ <http://somewhere/JohnSmith/> vCard:FN "John Smith" .
+ <http://somewhere/JohnSmith/> vCard:N _:b2 .
+ _:b2 vCard:Family "Smith" .
+ _:b2 vCard:Given "John" .
+
+ <http://somewhere/SarahJones/> vCard:FN "Sarah Jones" .
+ <http://somewhere/SarahJones/> vCard:N _:b3 .
+ _:b3 vCard:Family "Jones" .
+ _:b3 vCard:Given "Sarah" .
+
+É importante perceber que elas são as mesmas do grafo RDF e que as triplas no grafo não estão em alguma ordem particular. Elas são apenas escritas em grupos relacionados para a leitura humana – a máquina não se importa com isso.
+
+[Próximo: Uma consulta simples](sparql_query1.html)
+
+
+
Property changes on: trunk/content/tutorials/sparql_data_pt.mdtext
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property