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.
Neptune ne prend actuellement pas directement en charge les requêtes OpenSearch de plage. Cependant, vous pouvez obtenir le même effet en utilisant la syntaxe Lucene et query-type="query_string", comme vous pouvez le voir dans les exemples de requêtes suivants.
Obtenir tous les sommets de plus de 30 ans et dont le nom commence par « Si »
Dans Gremlin :
g.withSideEffect('Neptune#fts.endpoint', 'http://
your-es-endpoint
') .withSideEffect("Neptune#fts.queryType", "query_string") .V().has('*', 'Neptune#fts predicates.age.value:>30 && predicates.name.value:Si*');
En 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://localhost:9200' . neptune-fts:config neptune-fts:queryType 'query_string' . neptune-fts:config neptune-fts:query "predicates.\\*foaf\\*age.value:>30 AND predicates.\\*foaf\\*name.value:Si*" . neptune-fts:config neptune-fts:field '*' . neptune-fts:config neptune-fts:return ?res . } }
Dans ce cas, "\\*foaf\\*age
est utilisé à la place de l'URI complet par souci de concision. Cette expression régulière récupère tous les champs contenant foaf
et age
dans l'URI.
Obtenir tous les nœuds âgés de 10 à 50 ans et dont le nom a une correspondance floue avec « Ronka »
Dans Gremlin :
g.withSideEffect('Neptune#fts.endpoint', '
http://your-es-endpoint
') .withSideEffect("Neptune#fts.queryType", "query_string") .V().has('*', 'Neptune#fts predicates.age.value:[10 TO 50] AND predicates.name.value:Ronka~');
En 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://localhost:9200' . neptune-fts:config neptune-fts:queryType 'query_string' . neptune-fts:config neptune-fts:query "predicates.\\*foaf\\*age.value:[10 TO 50] AND predicates.\\*foaf\\*name.value:Ronka~" . neptune-fts:config neptune-fts:field '*' . neptune-fts:config neptune-fts:return ?res . } }
Obtenir tous les nœuds dont l'horodatage remonte aux 25 derniers jours
Dans Gremlin :
g.withSideEffect('Neptune#fts.endpoint', '
http://your-es-endpoint
') .withSideEffect("Neptune#fts.queryType", "query_string") .V().has('*', 'Neptune#fts predicates.timestamp.value:>now-25d');
En SPARQL :
PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX neptune-fts: <http://aws.amazon.com/neptune/vocab/v01/services/fts#> SELECT * WHERE { SELECT * WHERE { SERVICE neptune-fts:search { neptune-fts:config neptune-fts:endpoint 'http://localhost:9200' . neptune-fts:config neptune-fts:queryType 'query_string' . neptune-fts:config neptune-fts:query "predicates.\\*foaf\\*timestamp.value:>now-25d~" . neptune-fts:config neptune-fts:field '*' . neptune-fts:config neptune-fts:return ?res . } }
Obtenir tous les nœuds dont l'horodatage correspond à une année ou à un mois donnés
Dans Gremlin, avec des expressions mathématiques de date
g.withSideEffect('Neptune#fts.endpoint', '
http://your-es-endpoint
') .withSideEffect("Neptune#fts.queryType", "query_string") .V().has('*', 'Neptune#fts predicates.timestamp.value:>2020-12');
Alternative Gremlin :
g.withSideEffect('Neptune#fts.endpoint', '
http://your-es-endpoint
') .withSideEffect("Neptune#fts.queryType", "query_string") .V().has('*', 'Neptune#fts predicates.timestamp.value:[2020-12 TO 2021-01]');