Sorry if this is an overly simple question. I don’t know what I don’t know, so I’m having a hard time Googling for the right terms that I actually need to search for.
I’m not sure of how to best describe the issue other than provide the scenario. I’d say that I’m likely trying to remove the extraneous nodes in the response other than what filters down to the “deepest” value.
Here is the query I have now.
{
company(func: type(Company))
@filter(eq(ticker, "RDS") OR eq(ticker, "EQNR")) {
name, ~project.company {
name
}
}
}
This query pulls back what I want plus more. I want to find the nodes for Equinor and Shell and I want to find the “projects” that they mutually work on. It’s currently giving me both companies and ALL of the projects that they both work on. Essentially, “the Canyon Lime formation” and “the Timor Sea” are the only two that should be showing up below.
{
"data": {
"company": [
{
"name": "Equinor ASA",
"~project.company": [
{
"name": "the Timor Sea"
},
{
"name": "the Canyon Lime formation"
},
{
"name": "Tyrihans"
},
{
"name": "Oseberg C"
},
{
"name": "Oseberg C"
},
{
"name": "Oseberg C"
},
{
"name": "Ormen Lange"
},
{
"name": "Ivar Aasen"
},
{
"name": "the Barents Sea"
},
{
"name": "Johan Sverdrup"
},
{
"name": "Johan Castberg"
},
{
"name": "28 June"
},
{
"name": "Johan Castberg"
},
{
"name": "Martin Linge "
},
{
"name": "Martin Linge "
},
{
"name": "the Skarv field"
},
{
"name": "the Skarv field"
},
{
"name": "the Skarv field"
},
{
"name": "Askeladd"
},
{
"name": "Haltenbanken"
},
{
"name": "March"
},
{
"name": "November"
},
{
"name": "the UK sector"
},
{
"name": "the North Sea"
},
{
"name": "Jack"
},
{
"name": "Louisiana"
},
{
"name": "north east US"
},
{
"name": "north east US"
},
{
"name": "the Appalachian region"
},
{
"name": "Campos"
},
{
"name": "the Central Niger Delta region"
},
{
"name": "the Central Niger Delta region"
},
{
"name": "the Consolidated financial statements"
},
{
"name": "Equinor"
},
{
"name": "Southern"
},
{
"name": "Northern"
},
{
"name": "the Campos basin"
},
{
"name": "Uirapuru"
},
{
"name": "Canada"
},
{
"name": "Mariner"
}
]
},
{
"name": "Royal Dutch Shell",
"~project.company": [
{
"name": "Tobago"
},
{
"name": "the Hazira LNG and Port venture"
},
{
"name": "the Changbei II Phase 1 project"
},
{
"name": "Sichuan"
},
{
"name": "the Mid Tapti and South Tapti fields"
},
{
"name": "the Mid Tapti and South Tapti fields"
},
{
"name": "an onshore LNG project"
},
{
"name": "Khanty Mansiysk Autonomous District"
},
{
"name": "Concerto"
},
{
"name": "Woodside"
},
{
"name": "the Timor Sea"
},
{
"name": "Bonaparte"
},
{
"name": "the Rovuma Basin"
},
{
"name": "the Block 1 and 4 appraisal programme"
},
{
"name": "the Block 1 and 4 appraisal programme"
},
{
"name": "the Block 1 and 4 appraisal programme"
},
{
"name": "the La Vertiente gas processing plant"
},
{
"name": "Caipipendi"
},
{
"name": "NCMA blocks"
},
{
"name": "Atlantic Area"
},
{
"name": "the Canyon Lime formation"
}
]
}
]
},
"extensions": {
"server_latency": {
"parsing_ns": 14650,
"processing_ns": 3460629,
"encoding_ns": 115420,
"assign_timestamp_ns": 611824
},
"txn": {
"start_ts": 608762
}
}
}
Also, if it helps, this is the schema between those two types
Type: Company
company.doc - [Document]
company.group - [Group]
company.industry - [Industry]
company.location - [Location]
name - string
nativeName - string
otherNames - [string]
ticker - string
Type: Project
name - string
project.company - [Company]
project.field - [Field]
project.location - [Location]
status - string
Thanks ahead of time for the help. Please let me know if I missed something to add here.