-
Notifications
You must be signed in to change notification settings - Fork 17
Semantic Object Query Language
Martin Ledvinka edited this page Jul 10, 2026
·
9 revisions
The Semantic Object Query Language (SOQL) is an object query language analogous to JPQL (or HQL) designed for JOPA. Its main purpose is to simplify creation of queries over the object model managed by JOPA. SOQL queries are translated into SPARQL based on the metamodel and executed in a similar manner to the current support for SPARQL in JOPA.
The goal is to support as many features of JPQL as possible, but taking into account the specifics of SPARQL and ontologies.
-
SELECT,ASK(since 2.11.0) DISTINCT- Join by property path (
p.phone.number) -
LIKE,AND,OR,NOT, (since 0.20.0)IN, (since 1.1.0)MEMBER OF -
ORDER BY,GROUP BY COUNT- Comparison operators -
>,<,>=,<=,=,<>(alternatively!=) - (Since 0.22.0) Functions on strings -
UPPER,LOWER,LENGTH - (Since 0.22.0) Functions on numbers -
ABS,CEIL,FLOOR - (Since 0.22.0) Selection by identifier
- (Since 1.1.0) Language tag extraction function
LANG
Simple examples:
SELECT p FROM Person pSELECT p FROM Person p WHERE p.username = :usernameSELECT p FROM Person p WHERE NOT p.role = :roleSELECT p FROM Person p WHERE p.username LIKE :usernameSELECT p FROM Person p WHERE p.phone.number = :phoneNumberSELECT p FROM Person p WHERE p.age > :age ORDER BY p.age DESCSELECT p FROM Person p WHERE p.username IN :authorizedUsersSELECT p FROM Person p WHERE :adminType MEMBER OF p.typesSELECT t FROM Term t WHERE LANG(t.label) = :uiLanguageASK FROM Person p WHERE p.age > :age
See SoqlQueryParserTest for more examples.
The following features are not implemented, yet:
- Parentheses in the
WHEREclause OPTIONAL- Aggregation functions besides
count - Complex joins
- Projection of multiple entities or entity attributes -> currently, only an entity (or its count) can be projected from the query
- Inner selects