In order to run these examples, make sure that the default corpus is populated as described in Installation guide.
To construct a valid semantic query, after creating the query, you have to add at least one variable along with its class. As shown below, class names are relevant to the PROTON namespace used.
To add a name restriction, you have to specify a triple (variable - comparison style - value). For more details, please see JavaDoc about comparison styles.
To add a pattern restriction, you have to specify a triple (variable1 - relation - variable2). For more details on the specifics of these relations, please explore KIM Ontology.
Complex restriction are actually two or more attribute restrictions for the same variable. Let's say we want to get all documents created between 2001 and 2005. In order to do this, we should create a new ComplexAttributeRestriction object and set two AttributeRestriction s inside it.
Please, refer to API documentation for more information about ComplexAttributerestriction objects.
Depending on what you want to achieve, there are three different ways to execute semantic queries and process results.