翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
エクスポートされるデータをフィルタリングする方法の例を次に示します。
property-graph データのエクスポートのフィルタリング
scope
を使用してエッジのみをエクスポートする例
{
"command": "export-pg",
"params": {
"endpoint": "(your Neptune endpoint DNS name)
",
"scope": "edges"
},
"outputS3Path": "s3://(your Amazon S3 bucket)
/neptune-export"
}
nodeLabels
および edgeLabels
を使用して特定のラベルを持つノードとエッジのみをエクスポートする例
次の例の nodeLabels
パラメータは、Person
ラベルまたは Post
ラベルを持つノードのみをエクスポートするように指定しています。edgeLabels
パラメータは、likes
ラベルを持つエッジのみをエクスポートするように指定しています。
{
"command": "export-pg",
"params": {
"endpoint": "(your Neptune endpoint DNS name
)",
"nodeLabels": ["Person", "Post"],
"edgeLabels": ["likes"]
},
"outputS3Path": "s3://(your Amazon S3 bucket)
/neptune-export"
}
filter
を使用してノード、エッジ、およびプロパティのみをエクスポートする例
この例の filter
オブジェクトはcountry
ノードとそれらの type
、code
、desc
プロパティ、および route
エッジとその dist
プロパティをエクスポートします。
{
"command": "export-pg",
"params": {
"endpoint": "(your Neptune endpoint DNS name)
",
"filter": {
"nodes": [
{
"label": "country",
"properties": [
"type",
"code",
"desc"
]
}
],
"edges": [
{
"label": "route",
"properties": [
"dist"
]
}
]
}
},
"outputS3Path": "s3://(your Amazon S3 bucket)
/neptune-export"
}
gremlinFilter
を使用する例
この例では gremlinFilter
を使用して 2021-10-10 より後に作成されたノードとエッジ (つまり、2021-10-10より大きい値を持つ created
プロパティ) のみをエクスポートします。
{
"command": "export-pg",
"params": {
"endpoint": "(your Neptune endpoint DNS name)
",
"gremlinFilter" : "has(\"created\", gt(datetime(\"2021-10-10\")))"
},
"outputS3Path": "s3://(your Amazon S3 bucket)
/neptune-export"
}
gremlinNodeFilter
を使用する例
この例では gremlinNodeFilter
を使用して削除されたノード (値が true
のブール値 deleted
プロパティを持つノード) のみをエクスポートします。
{
"command": "export-pg",
"params": {
"endpoint": "(your Neptune endpoint DNS name)
",
"gremlinNodeFilter" : "has(\"deleted\", true)"
},
"outputS3Path": "s3://(your Amazon S3 bucket)
/neptune-export"
}
gremlinEdgeFilter
を使用する例
この例では gremlinEdgeFilter
を使用して値が 5 の strength
数値プロパティを持つエッジのみをエクスポートします。
{
"command": "export-pg",
"params": {
"endpoint": "(your Neptune endpoint DNS name)
",
"gremlinEdgeFilter" : "has(\"strength\", 5)"
},
"outputS3Path": "s3://(your Amazon S3 bucket)
/neptune-export"
}
filter
、gremlinNodeFilter
、nodeLabels
、edgeLabels
、scope
を組み合わせる
この例の filter
オブジェクトは次をエクスポートします。
country
ノードとそれらのtype
、code
、desc
プロパティairport
ノードとそれらのicao
、code
、runways
プロパティroute
エッジとそのdist
プロパティ
gremlinNodeFilter
パラメータはノードをフィルタリングするため、値が A で始まる code
プロパティのみがエクスポートされます。
nodeLabels
および edgeLabels
パラメータは出力をさらに制限し、airport
ノードおよび route
エッジのみがエクスポートされます。
最後に、scope
パラメータはエクスポートからエッジを削除し、出力には指定した airport
ノードだけが残されます。
{
"command": "export-pg",
"params": {
"endpoint": "(your Neptune endpoint DNS name)
",
"filter": {
"nodes": [
{
"label": "airport",
"properties": [
"code",
"icao",
"runways"
]
},
{
"label": "country",
"properties": [
"type",
"code",
"desc"
]
}
],
"edges": [
{
"label": "route",
"properties": [
"dist"
]
}
]
},
"gremlinNodeFilter": "has(\"code\", startingWith(\"A\"))",
"nodeLabels": [
"airport"
],
"edgeLabels": [
"route"
],
"scope": "nodes"
},
"outputS3Path": "s3://(your Amazon S3 bucket)
/neptune-export"
}
RDF データのエクスポートのフィルタリング
rdfExportScope
および sparql
を使用して特定のエッジをエクスポートする
この例では、述語が <http://kelvinlawrence.net/air-routes/objectProperty/route> で、オブジェクトがリテラルでないトリプルをエクスポートします。
{
"command": "export-rdf",
"params": {
"endpoint": "(your Neptune endpoint DNS name)
",
"rdfExportScope": "query",
"sparql": "CONSTRUCT { ?s <http://kelvinlawrence.net/air-routes/objectProperty/route> ?o } WHERE { ?s ?p ?o . FILTER(!isLiteral(?o)) }"
},
"outputS3Path": "s3://(your Amazon S3 bucket)
/neptune-export"
}
を使用して単一の名前付きグラフをエクスポートnamedGraph
する
この例では、名前付きグラフ <http://aws.amazon.com/neptune/vocab/v01/DefaultNamedGraph> に属するトリプルをエクスポートします。
{
"command": "export-rdf",
"params": {
"endpoint": "(your Neptune endpoint DNS name)",
"rdfExportScope": "graph",
"namedGraph": "http://aws.amazon.com/neptune/vocab/v01/DefaultNamedGraph"
},
"outputS3Path": "s3://(your Amazon S3 bucket)/neptune-export"
}