Contoh kueri SPARQL menggunakan pencarian teks lengkap di Neptune - Amazon Neptune

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

Contoh kueri SPARQL menggunakan pencarian teks lengkap di Neptune

Berikut ini adalah beberapa contoh kueri SPARQL yang menggunakan pencarian teks lengkap di Amazon Neptune.

Contoh kueri pencocokan SPARQL

PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX neptune-fts: <http://aws.amazon.com/neptune/vocab/v01/services/fts#> SELECT * WHERE { SERVICE neptune-fts:search { neptune-fts:config neptune-fts:endpoint 'http://your-es-endpoint.com' . neptune-fts:config neptune-fts:queryType 'match' . neptune-fts:config neptune-fts:field foaf:name . neptune-fts:config neptune-fts:query 'michael' . neptune-fts:config neptune-fts:return ?res . } }

Contoh kueri awalan SPARQL

PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX neptune-fts: <http://aws.amazon.com/neptune/vocab/v01/services/fts#> SELECT * WHERE { SERVICE neptune-fts:search { neptune-fts:config neptune-fts:endpoint 'http://your-es-endpoint.com' . neptune-fts:config neptune-fts:queryType 'prefix' . neptune-fts:config neptune-fts:field foaf:name . neptune-fts:config neptune-fts:query 'mich' . neptune-fts:config neptune-fts:return ?res . } }

Contoh kueri fuzzy SPARQL

PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX neptune-fts: <http://aws.amazon.com/neptune/vocab/v01/services/fts#> SELECT * WHERE { SERVICE neptune-fts:search { neptune-fts:config neptune-fts:endpoint 'http://your-es-endpoint.com' . neptune-fts:config neptune-fts:queryType 'fuzzy' . neptune-fts:config neptune-fts:field foaf:name . neptune-fts:config neptune-fts:query 'mikael' . neptune-fts:config neptune-fts:return ?res . } }

Contoh istilah SPARQL

PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX neptune-fts: <http://aws.amazon.com/neptune/vocab/v01/services/fts#> SELECT * WHERE { SERVICE neptune-fts:search { neptune-fts:config neptune-fts:endpoint 'http://your-es-endpoint.com' . neptune-fts:config neptune-fts:queryType 'term' . neptune-fts:config neptune-fts:field foaf:name . neptune-fts:config neptune-fts:query 'Dr. Kunal' . neptune-fts:config neptune-fts:return ?res . } }

Contoh kueri query_string SPARQL

Kueri ini menentukan beberapa bidang.

PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX neptune-fts: <http://aws.amazon.com/neptune/vocab/v01/services/fts#> SELECT * WHERE { SERVICE neptune-fts:search { neptune-fts:config neptune-fts:endpoint 'http://your-es-endpoint.com' . neptune-fts:config neptune-fts:queryType 'query_string' . neptune-fts:config neptune-fts:query 'mikael~ OR rondelli' . neptune-fts:config neptune-fts:field foaf:name . neptune-fts:config neptune-fts:field foaf:surname . neptune-fts:config neptune-fts:return ?res . } }

Contoh kueri simple_query_string SPARQL

Kueri berikut menentukan bidang menggunakan karakter wildcard ('*').

PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX neptune-fts: <http://aws.amazon.com/neptune/vocab/v01/services/fts#> SELECT * WHERE { SERVICE neptune-fts:search { neptune-fts:config neptune-fts:endpoint 'http://your-es-endpoint.com' . neptune-fts:config neptune-fts:queryType 'simple_query_string' . neptune-fts:config neptune-fts:query 'mikael~ | rondelli' . neptune-fts:config neptune-fts:field '*' . neptune-fts:config neptune-fts:return ?res . } }

SPARQL urutkan berdasarkan contoh kueri bidang string

PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX neptune-fts: <http://aws.amazon.com/neptune/vocab/v01/services/fts#> SELECT * WHERE { SERVICE neptune-fts:search { neptune-fts:config neptune-fts:endpoint 'http://your-es-endpoint' . neptune-fts:config neptune-fts:queryType 'query_string' . neptune-fts:config neptune-fts:query 'mikael~ | rondelli' . neptune-fts:config neptune-fts:field foaf:name . neptune-fts:config neptune-fts:sortOrder 'asc' . neptune-fts:config neptune-fts:sortBy foaf:name . neptune-fts:config neptune-fts:return ?res . } }

SPARQL urutkan berdasarkan contoh kueri bidang non-string

PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX neptune-fts: <http://aws.amazon.com/neptune/vocab/v01/services/fts#> SELECT * WHERE { SERVICE neptune-fts:search { neptune-fts:config neptune-fts:endpoint 'http://your-es-endpoint' . neptune-fts:config neptune-fts:queryType 'query_string' . neptune-fts:config neptune-fts:query 'mikael~ | rondelli' . neptune-fts:config neptune-fts:field foaf:name.value . neptune-fts:config neptune-fts:sortOrder 'asc' . neptune-fts:config neptune-fts:sortBy dc:date.value . neptune-fts:config neptune-fts:return ?res . } }

SPARQL urutkan berdasarkan contoh kueri ID

PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX neptune-fts: <http://aws.amazon.com/neptune/vocab/v01/services/fts#> SELECT * WHERE { SERVICE neptune-fts:search { neptune-fts:config neptune-fts:endpoint 'http://your-es-endpoint' . neptune-fts:config neptune-fts:queryType 'query_string' . neptune-fts:config neptune-fts:query 'mikael~ | rondelli' . neptune-fts:config neptune-fts:field foaf:name . neptune-fts:config neptune-fts:sortOrder 'asc' . neptune-fts:config neptune-fts:sortBy 'Neptune#fts.entity_id' . neptune-fts:config neptune-fts:return ?res . } }

SPARQL urutkan berdasarkan contoh kueri label

PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX neptune-fts: <http://aws.amazon.com/neptune/vocab/v01/services/fts#> SELECT * WHERE { SERVICE neptune-fts:search { neptune-fts:config neptune-fts:endpoint 'http://your-es-endpoint' . neptune-fts:config neptune-fts:queryType 'query_string' . neptune-fts:config neptune-fts:query 'mikael~ | rondelli' . neptune-fts:config neptune-fts:field foaf:name . neptune-fts:config neptune-fts:sortOrder 'asc' . neptune-fts:config neptune-fts:sortBy 'Neptune#fts.entity_type' . neptune-fts:config neptune-fts:return ?res . } }

SPARQL urutkan berdasarkan contoh kueri doc_type

PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX neptune-fts: <http://aws.amazon.com/neptune/vocab/v01/services/fts#> SELECT * WHERE { SERVICE neptune-fts:search { neptune-fts:config neptune-fts:endpoint 'http://your-es-endpoint' . neptune-fts:config neptune-fts:queryType 'query_string' . neptune-fts:config neptune-fts:query 'mikael~ | rondelli' . neptune-fts:config neptune-fts:field foaf:name . neptune-fts:config neptune-fts:sortOrder 'asc' . neptune-fts:config neptune-fts:sortBy 'Neptune#fts.document_type' . neptune-fts:config neptune-fts:return ?res . } }

Contoh menggunakan sintaks Lucene di SPARQL

sintaks Lucene hanya didukung untukquery_string query di OpenSearch.

PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX neptune-fts: <http://aws.amazon.com/neptune/vocab/v01/services/fts#> SELECT * WHERE { SERVICE neptune-fts:search { neptune-fts:config neptune-fts:endpoint 'http://your-es-endpoint' . neptune-fts:config neptune-fts:queryType 'query_string' . neptune-fts:config neptune-fts:queryType 'query_string' . neptune-fts:config neptune-fts:query 'predicates.\\foaf\\name.value:micheal AND predicates.\\foaf\\surname.value:sh' . neptune-fts:config neptune-fts:field ‘’ . neptune-fts:config neptune-fts:return ?res . } }