官术网_书友最值得收藏!

Generic structure of an SPARQL query

The generic structure of SPARQL is as follows:

  • PREFIX: Similar to the declaration of namespaces in the context of XML, and package in the context of Java, or any similar programming languages, PREFIX is the SPARQL equivalent, which ensures uniqueness among entity representations and eliminates the need for typing long URI patterns within SPARQL code. 
  • SELECT / ASK / DESCRIBE / CONSTRUCT:
    • SELECT: This is an equivalent of SQL's SELECT clause. It defines the attributes that are required to be fetched from the RDF triples that fulfill the selection criteria. 
    • ASK: This returns a Boolean value of true or false depending on the availability of the RDF triples, and based on the selection criteria within the RDF knowledge base. 
    • DESCRIBE: This query construct returns a graph containing all the available triples from the RDF knowledge base which match the selection criteria. 
    • CONSTRUCT: This is very handy when creating a new RDF graph from an existing RDF based on selection criteria and filter conditions. This is the equivalent of XSLT in the context of XML. XSLT transforms XML in the intended format. 
  • FROM: Defines the data source of the RDF endpoint, against which the query will be run. This is the SQL equivalent of the FROM <TABLE_NAME> clause. The endpoint can be a resource on the internet or a local data store accessible to the query engine. 
  • WHERE: Defines the part of the RDF graph we are interested in. This is the equivalent of the WHERE SQL clause which defines filter conditions to fetch specific data from the entire dataset. 
主站蜘蛛池模板: 五莲县| 都江堰市| 托里县| 沅陵县| 阿拉尔市| 介休市| 闵行区| 安溪县| 融水| 高尔夫| 屏东县| 陕西省| 遂平县| 安徽省| 冀州市| 昔阳县| 麻江县| 临武县| 中西区| 台北市| 海安县| 宝清县| 江阴市| 陵川县| 永福县| 新昌县| 杭锦后旗| 韶关市| 牟定县| 台东县| 门源| 通江县| 长白| 兴宁市| 德阳市| 铜鼓县| 陆川县| 巴里| 中阳县| 乡城县| 噶尔县|