ExRam.Gremlinq: OfType() is broken
Describe the bug
I am trying to implment a wrapper around your client and am running into issues w/the OfType<T>() method. I’m trying to replicate the How_many_pets_does_everybody_have()
method from the test project. I am getting a different result than you are. I am pointing to the same Database and Graph and have the same object model in both projects.
The OfType<T>()
when T
is a base class (i.e., Pet
) is expected to reflect and determine any classes that inherit from it and should return a list of Type
s (i.e., Dog, Cat, Pet
).
Your test project produces:
V().hasLabel('Person').out('Owns').hasLabel('Cat','Dog','Pet')
which is correct and what I expect.
My implementation produces:
V().hasLabel('Person').out('Owns').hasLabel('Pet')
which is incorrect.
I have the same exact code, same class model, but different output. I tried cloning your repo and fixing whatever the issue is in the OfType<T>()
extension but the solution won’t build.
Here is my code and some screenshots showing what’s going on:
- My code is on left
- Your sample project is on the right
- You will see that I don’t get Cat or Dog
Pet
Mammal
Vertex
Dog
Cat
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 27 (10 by maintainers)
For an ASP WebApi, you’re probably better off with the other sample app.
For the ExRam.Gremlinq project not building, I cannot reproduce. Everything builds fine in VS 2022 and on the build server.
In your sample code, the only configuration of a GraphModel is, for whatever reason, commented out and reads
Gremlinq has no ability to lookup all the Pet-derived classes when it only considers the assembly of Vertex and Edge, which are not in the same assembly as Pet or anything else, as far as I can see. There’s a method to include more assemblies.
Hello @DocGreenRob, thanks for your interest in ExRam.Gremlinq. The issue was labelled “Repro repository missing” because although the issue template asks for either “a link to GitHub repository containing a minimal executable project structure that exposes the unexpected behaviour” or “a pull request to ExRam.Gremlinq that adds a failing unit test to the ExRam.Gremlinq tests asserting the expected behaviour”, it seems you provided neither. Most problems already solve themselves when isolated and if they don’t, you will have made it easier for the maintainer of this project to investigate a possible bug.