سباركل

(بالتحويل من SPARQL)

SPARQL (تلفظ سباركل [١]) هي لغة استعلام RDF، وهي اختصار عودي لـ SPARQL Protocol and RDF Query Language (بروتوكول سباركل ولغة استعلام RDF).

المنافع

تسمح لغة استعلام سباركل للمستخدمين بكتابة استعلامات عمومية غير مبهمة. على سبيل المثال، الاستعلام التالي يعيد الاسم والبريد الإلكتروني العائدين لكل إنسان في العالم:

<source lang="sql"> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?name ?email WHERE {

 ?person a foaf:Person.
 ?person foaf:name ?name.
 ?person foaf:mbox ?email.

} </source>

وذلك بافتراض أن الأنطولوجيات تتقارب في استخدامها لوصف شخص ما إلى أنطولوجية FOAF. هذا المثال يوضح رؤية الوب الدلالي لمعاملة الوب كقاعدة بيانات واحدة ضخمة. لاحظ أيضاً أن هذه العمومية غير المبهمة تعود إلى حقيقة أن كل دلال identifier في سباركل، URI، هو غير مبهم عمومياً، على عكس دلال مثل "email" أو "e-mail" المستخدمة في لغة SQL.

مثال

Another SPARQL query example that models the question "What are all the country capitals in Africa?": <source lang="sql"> PREFIX abc: <http://example.com/exampleOntology#> SELECT ?capital ?country WHERE {

 ?x abc:cityname ?capital ;
    abc:isCapitalOf ?y .
 ?y abc:countryname ?country ;
    abc:isInContinent abc:Africa .

} </source>

Variables are indicated by a "?" or "$" prefix. Bindings for ?capital and the ?country will be returned.

The SPARQL query processor will search for sets of triples that match these four triple patterns, binding the variables in the query to the corresponding parts of each triple. Important to note here is the "property orientation" (class matches can be conducted solely through class-attributes / properties - see Duck typing)

To make queries concise, SPARQL allows the definition of prefixes and base URIs in a fashion similar to Turtle. In this query, the prefix "abc" stands for “http://example.com/exampleOntology#”.

مراجع

  1. ^ Jim Rapoza (May 2, 2006). SPARQL Will Make the Web Shine. eWeek. Retrieved 2007-01-17.

وصلات خارجية

de:SPARQL SPARQL]] es:SPARQL fr:SPARQL it:SPARQL ja:SPARQL lv:SPARQL pl:SPARQL ru:SPARQL zh:SPARQL