Exemples de requêtes SPARQL utilisant la recherche en texte intégral dans Neptune - Amazon Neptune

Les traductions sont fournies par des outils de traduction automatique. En cas de conflit entre le contenu d'une traduction et celui de la version originale en anglais, la version anglaise prévaudra.

Exemples de requêtes SPARQL utilisant la recherche en texte intégral dans Neptune

Voici quelques exemples de requêtes SPARQL qui utilisent la recherche en texte intégral dans Amazon Neptune.

Exemple de requête de correspondance 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 . } }

Exemple de requête de préfixe 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 . } }

Exemple de requête partielle 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 . } }

Exemple de requête de terme 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 . } }

Exemple de requête query_string SPARQL

Cette requête spécifie plusieurs champs.

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

Exemple de requête simple_query_string SPARQL

La requête suivante spécifie les champs utilisant le caractère générique (« * »).

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

Exemple de requête de tri par champ de chaîne 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 . } }

Exemple de requête de de tri de champ hors chaîne 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 . } }

Exemple de requête de tri par ID 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 . } }

Exemple de requête de tri par étiquette 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 . } }

Exemple de requête de tri par doc_type 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 . } }

Exemple d'utilisation de la syntaxe Lucene en SPARQL

La syntaxe Lucene n'est prise en charge que pour les requêtes query_string dans 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 . } }