Movies db query returning more information than expected: Is my Query wrong?

What I want to do

I want to list the names of all movies loaded from 1million.rdf.

What I did

{
  me(func: eq(dgraph.type, "Movie")) {
    name
  }
}

– returns 0 results

{
  me(func: eq(dgraph.type, "Movie")) {
    name@.
  }
}

– returns things that, AFAIK, are NOT movie names

example:

{
  "data": {
    "me": [
      {
        "name@.": "Rita O'Grady"
      },
      {
        "name@.": "Monica"
      },
      {
        "name@.": "Reporter #3"
      },
      {
        "name@.": "Dagenham Striker #13"
      },
      {
        "name@.": "Dagenham Striker #17"
      },
      {
        "name@.": "Talbot"
      }

Dgraph metadata

dgraph version

Dgraph version : v21.03.1
Dgraph codename : rocket-1
Dgraph SHA-256 : a00b73d583a720aa787171e43b4cb4dbbf75b38e522f66c9943ab2f0263007fe
Commit SHA-1 : ea1cb5f35
Commit timestamp : 2021-06-17 20:38:11 +0530
Branch : HEAD
Go version : go1.16.2
jemalloc enabled : true

The whole data isn’t important as it is just an example used in the Tutorial. So it is not critical. Not all users should be digging the dataset. But if you wanna dig it and fix it, feel free to open a PR.

Cheers.

Are you saying this is an issue with the data, and my query is correct?

Maybe I should have clarified: My issue isn’t with the data itself, but is my query broken?
I’m still trying to grasp the fundamentals, so seeing this sort of data return makes me very confused.

I’m not sure. Those names could be documentaries and movie about those people. I was trusting in you about your complaining. Need to check, but even tho, that would not be a problem.

I don’t think so. The difference is that nothing is recorded in the predicate name without language feature. It is normal to see nothing there, only when you query for the language versions.

If you could, please, that would help with my confusion. With my query I thought I should only see movie titles. Seeing other names that aren’t titles makes me think there’s a concept with Types and queries I don’t understand.

Right now in my head it’s like I asked the query to show me numbers, and the results are: 1, 2, purple, car, and I don’t understand why purple and car are there. I hope I’m making better sense now.

And if my query is right and it’s just the way the data is, then I can tell myself I understand and move forward.

Yes, thank you, I did finally figure that part out! 1 confusion element checked off.

Thank you for your help!

Your query is right. Don’t bother with it.

Don’t bother, just use the logic. Don’t do assumptions based on that dataset.

Again, just ignore it.

I gonna explain your query:

This have to return from the dataset only movies. If it return something else, the dataset is “corrupted”. BTW, you are using dgraph.type instead of Type() e.g:

{
  me(func: type("Movie")) {
    name
  }
}

The above query is the same thing, but you should use that last one.

This does the same as before, but it “Looks for an untagged string, then any language.”

1 Like

Thank you so much for clarifying. I shall continue my exploration and lessons!