Is it mandatory to use attributes for resources description?
Opened this issue · 1 comments
When I use resources that have no [RdfClass] attribute like Model.AsQueryable<R>.Skip(0).Take(5).ToList;
I get an exception:
[DotToken at Line 1 Column 129 to Line 1 Column 130] Unexpected DOT in graph pattern.
Note: I used alternative method to describe resources, overriding GetType and assigning MappingProperty<>.
Generated SPARQL query is missing the part where SPO is filtered against RDF type:
I've pushed some test code in my fork:
branch: https://github.com/IgorKaplya/trinity-rdf/tree/SPARQL-not-generated-without-attribute
fixture: LinqTestBase
test: CanSelectResourcesWithAsQueryableWithoutAttributes
For now I have to use both: Attribute and the approach with GetType().
Hi Igor, sorry for the late reply. This is probably an issue with the SparqlQueryGenerator.
The issue seems to be that GetType()
only works on instances and the query generator only has a reference to a type. We'd need to temporarily create an instance of the type and invoke the GetType method to read the types this way which is quite an expensive operation..