Package org.apache.stanbol.entityhub.servicesapi.query

Examples of org.apache.stanbol.entityhub.servicesapi.query.Constraint


     * @param jConstraint
     * @return
     * @throws JSONException
     */
    private static Constraint parseRangeConstraint(JSONObject jConstraint) throws JSONException {
        Constraint constraint;
        boolean inclusive;
        if(jConstraint.has("inclusive")){
            inclusive = jConstraint.getBoolean("inclusive");
        } else {
            log.info("RangeConstraint does not define the field 'inclusive'. Use false as default!");
View Full Code Here


     * @param jConstraint
     * @return
     * @throws JSONException
     */
    private static Constraint parseTextConstraint(JSONObject jConstraint) throws JSONException {
        Constraint constraint;
        boolean caseSensitive = jConstraint.optBoolean("caseSensitive", false);
        //parse patternType
        PatternType patternType;
        String jPatternType = jConstraint.optString("patternType",null);
        if(jPatternType == null){
View Full Code Here

     * @param jConstraint
     * @return
     * @throws JSONException
     */
    private static Constraint parseValueConstraint(JSONObject jConstraint) throws JSONException {
        Constraint constraint;
        Collection<String> dataTypes = parseDatatypeProperty(jConstraint);
        final List<Object> valueList;
        if(jConstraint.has("value") && !jConstraint.isNull("value")){
            Object value = jConstraint.get("value");
            if(value instanceof JSONArray){
View Full Code Here

     * @param jConstraint
     * @return
     * @throws JSONException
     */
    private static Constraint parseReferenceConstraint(JSONObject jConstraint) throws JSONException {
        Constraint constraint;
        final List<String> refList;
        if(jConstraint.has("value") && !jConstraint.isNull("value")){
            Object value = jConstraint.get("value");
            if(value instanceof JSONArray){
                refList = new ArrayList<String>(((JSONArray)value).length());
View Full Code Here

                    queryString.append("    WHERE { \n");
                }
                first = false;
            }
            String field = fieldConstraint.getKey();
            Constraint constraint = fieldConstraint.getValue();
            switch (constraint.getType()) {
            case value:
                addValueConstraint(queryString,field, (ValueConstraint)constraint,selectedFields, varPrefix,varNum,intend);
                break;
            case text:
                String var = addFieldGraphPattern(queryString, field, selectedFields, varPrefix, varNum,intend);
View Full Code Here

        FieldQuery query = queryFactory.createFieldQuery();

        // replace spaces with plus to create an AND search for all words in the
        // name!
        Constraint labelConstraint;
        // TODO: make case sensitivity configurable
        boolean casesensitive = false;
        String namedEntityLabel = casesensitive ? namedEntity.getName() : namedEntity.getName().toLowerCase();
        if (language != null) {
            // search labels in the language and without language
View Full Code Here

     * @param jConstraint
     * @return
     * @throws JSONException
     */
    private static Constraint parseRangeConstraint(JSONObject jConstraint) throws JSONException {
        Constraint constraint;
        boolean inclusive;
        if(jConstraint.has("inclusive")){
            inclusive = jConstraint.getBoolean("inclusive");
        } else {
            log.info("RangeConstraint does not define the field 'inclusive'. Use false as default!");
View Full Code Here

     * @param jConstraint
     * @return
     * @throws JSONException
     */
    private static Constraint parseTextConstraint(JSONObject jConstraint) throws JSONException {
        Constraint constraint;
        boolean caseSensitive = jConstraint.optBoolean("caseSensitive", false);
        //parse patternType
        PatternType patternType;
        String jPatternType = jConstraint.optString("patternType",null);
        if(jPatternType == null){
View Full Code Here

     * @param jConstraint
     * @return
     * @throws JSONException
     */
    private static Constraint parseValueConstraint(JSONObject jConstraint) throws JSONException {
        Constraint constraint;
        Collection<String> dataTypes = parseDatatypeProperty(jConstraint);
        if(jConstraint.has("value") && !jConstraint.isNull("value")){
            constraint = new ValueConstraint(jConstraint.get("value"), dataTypes);
        } else {
            log.warn("Parsed ValueConstraint does not define the required field \"value\"!");
View Full Code Here

     * @param jConstraint
     * @return
     * @throws JSONException
     */
    private static Constraint parseReferenceConstraint(JSONObject jConstraint) throws JSONException {
        Constraint constraint;
        if(jConstraint.has("value") && !jConstraint.isNull("value")){
            constraint = new ReferenceConstraint(jConstraint.getString("value"));
        } else {
            log.warn("Parsed ReferenceConstraint does not define the required field \"value\"!");
            StringBuilder message = new StringBuilder();
View Full Code Here

TOP

Related Classes of org.apache.stanbol.entityhub.servicesapi.query.Constraint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.