Consultas de SPARQL de ejemplo mediante la búsqueda de texto completo en Neptune - Amazon Neptune

Las traducciones son generadas a través de traducción automática. En caso de conflicto entre la traducción y la version original de inglés, prevalecerá la version en inglés.

Consultas de SPARQL de ejemplo mediante la búsqueda de texto completo en Neptune

A continuación, se presentan algunos ejemplos de consultas de SPARQL que utilizan la búsqueda de texto completo en Amazon Neptune.

Ejemplo de consulta match de 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 . } }

Ejemplo de consulta prefix de 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 . } }

Ejemplo de consulta fuzzy de 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 . } }

Ejemplo de consulta term de 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 . } }

Ejemplo de consulta query_string de SPARQL

Esta consulta especifica varios campos.

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 . } }

Ejemplo de consulta simple_query_string de SPARQL

La siguiente consulta especifica los campos con el carácter comodín ("*").

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 . } }

Ejemplo de consulta sort by string field de 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' . 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 . } }

Ejemplo de consulta sort by non-string field de 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' . 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 . } }

Ejemplo de consulta sort by ID de 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' . 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 . } }

Ejemplo de consulta sort by label de 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' . 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 . } }

Ejemplo de consulta sort by doc_type de 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' . 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 . } }

Ejemplo del uso de la sintaxis de Lucene en SPARQL

La sintaxis de Lucene solo es compatible con las consultas query_string de 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 . } }