You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then the method could take the form of a static method getSparqlSelectQuery(parameters?: SparqlQueryParameter[]).
Maybe this should not be part of the SemanticObject class? The Decorator design pattern could also be used.
Note: we don't to generate SPARQL queries in the connector codegen to keep it simple. It's better to have this is Semantizer.
Use object as criteria
In the SemanticObject class we could have a find method:
SemanticObject.find(){// 1. Generate the SPARQL from all the semantic properties of the object.// 2. Create a cancel-able command containing the SPARQL.// 3. Send the command to the query planner.}
Then we can create semantic objects for finding:
newSemanticObject(params...).find()
--> PB when we want to query several values for a property with only one value allowed.
Use findBy methods
Create findBy... methods like:
publicstaticasyncCatalog.findByMaintainer(connector: IConnector,maintainer: Semanticablecallback: Function): Promise<void>{returnconnector.find(Catalog.TYPE,maintainer,callback);}publicasyncConnector.findCatalogByMaintainer(maintainer: Semanticable,callback: Function): Promise<void>{returnthis.getSemantizer().find("dfc-b:Catalog","dfc-b:maintainedBy",maintainer,callback);}// Or with collections:Connector.catalog.findByMaintainer();Connector.address.findByCountry();
The text was updated successfully, but these errors were encountered:
In order to query and find data, we should be able to generate a simple SPARQL SELECT query.
This query should support WHERE parameters constructed from the semantic properties.
To do so, we could define a
SparqlQueryParameter
interface like:Then the method could take the form of a static method
getSparqlSelectQuery(parameters?: SparqlQueryParameter[])
.Maybe this should not be part of the
SemanticObject
class? The Decorator design pattern could also be used.Note: we don't to generate SPARQL queries in the connector codegen to keep it simple. It's better to have this is Semantizer.
Use object as criteria
In the
SemanticObject
class we could have afind
method:Then we can create semantic objects for finding:
--> PB when we want to query several values for a property with only one value allowed.
Use findBy methods
Create
findBy...
methods like:The text was updated successfully, but these errors were encountered: