# Set\_indexing\_prop!() in MetaGraph gives an error

**URL:** https://discourse.julialang.org/t/set-indexing-prop-in-metagraph-gives-an-error/54912
**Category:** General Usage
**Created:** [February 9, 2021, 9:56am UTC](https://discourse.julialang.org/t/set-indexing-prop-in-metagraph-gives-an-error/54912 "2021-02-09T09:56:32Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![AlexanderChen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alexanderchen/32/22007_2.png) [@AlexanderChen](https://discourse.julialang.org/u/AlexanderChen)
#### Post date: [February 9, 2021, 9:56am UTC](https://discourse.julialang.org/t/set-indexing-prop-in-metagraph-gives-an-error/54912/1 "2021-02-09T09:56:32Z")

</div>

Hi,

I am testing the ability to use MetaGraph to filter through a graph.

context:  
node 1 is the table which I want to metaindex with the type : “Source”.  
This seems to work fine until I want to set the index (linenumber 4 in the blurp)

```julia
T1 = star_graph(6)
T1_nodelabel = ["T1","C1.1","C1.2","C1.3","C1.4","C1.5"]
mg = MetaGraph(T1, 3.0)
set_prop!(mg, 1, :type, "Source")
set_indexing_prop!(mg, :type)
gplot(mg, nodelabel=T1_nodelabel, nodelabelsize= 0.1, nodelabelc ="white")

```

I get this erro message:

```julia
julia> set_indexing_prop!(mg, :type)
ERROR: MethodError: no method matching default_index_value(::Int64, ::Symbol, ::Set{String}; exclude=nothing)
Closest candidates are:
  default_index_value(::Integer, ::Symbol, ::Set{Any}; exclude) at C:\Users\achen\.julia\packages\MetaGraphs\SUjFO\src\MetaGraphs.jl:350
Stacktrace:
 [1] set_indexing_prop!(::MetaGraph{Int64,Float64}, ::Symbol; exclude::Nothing) at C:\Users\achen\.julia\packages\MetaGraphs\SUjFO\src\MetaGraphs.jl:378
 [2] set_indexing_prop!(::MetaGraph{Int64,Float64}, ::Symbol) at C:\Users\achen\.julia\packages\MetaGraphs\SUjFO\src\MetaGraphs.jl:370
 [3] top-level scope at REPL[57]:1

```

I can’t figure out what the problem is.

thanks in advance.

best,

---

<div class="post-metadata">

### Author: ![AlexanderChen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alexanderchen/32/22007_2.png) [@AlexanderChen](https://discourse.julialang.org/u/AlexanderChen)
#### Post date: [February 11, 2021, 6:45am UTC](https://discourse.julialang.org/t/set-indexing-prop-in-metagraph-gives-an-error/54912/2 "2021-02-11T06:45:06Z")

</div>

I will reply on my own question since I think someone in the future might need this.

there are 2 problems here and none have to do with the actual syntax.

1. it is not allowed in Metagraph as far as I can see, to only give 1 node a metaproperty. Its either all node or no nodes.
2. And this one is kinda annoying and I find personally a little disappointing, the property description needs to be unique. So you CANNOT do a search index on :type if you only have two types and more then 2 nodes. So in this case you CAN give every node a type of either “Table” or “Column” but you CANNOT search on that via an index. I don’t know why they couldnt give an array of mutiple nodes back that fit the same filter ‘Column’, you can make a filter function. The flaw here goes quite deep. Lets say you have a family tree, you cannot use Metagraph out of the box to index search on terms like “father” or “son”…
