Example #1
0
    def token_prefix(value):
        """
        Search any instance of a certain token prefix withing the text property targeted.

        :param value: the value to look for.
        """
        return P('tokenPrefix', value)
Example #2
0
    def token_regex(value):
        """
        Search any instance of the provided regular expression for the targeted property.

        :param value: the value to look for.
        """
        return P('tokenRegex', value)
Example #3
0
    def token(value):
        """
        Search any instance of a certain token within the text property targeted.

        :param value: the value to look for.
        """
        return P('token', value)
Example #4
0
    def prefix(value):
        """
        Search for a specific prefix at the beginning of the text property targeted.

        :param value: the value to look for.
        """
        return P('prefix', value)
Example #5
0
    def regex(value):
        """
        Search for this regular expression inside the text property targeted.

        :param value: the value to look for.
        """
        return P('regex', value)
Example #6
0
    def textPrefix(value):
        """
        Implements JanusGraph's textPrefix functionality.
        Returns true if the string value starts with the given query string

        Args:
            value (str):

        Returns:
            bool: Returns true iff the string value starts with the given query string.
        """
        return P("textPrefix", value)
Example #7
0
    def textContainsPrefix(value):
        """
        Implements JanusGraph's textContainsFuzzy functionality.
        Returns true if (at least) one word inside the text string begins with the query string

        Args:
            value (str):

        Returns:
            bool: Returns true iff one word (at least) inside the text string begins with the query string.
        """
        return P("textContainsPrefix", value)
Example #8
0
    def textPrefix(value):
        """
        Implements JanusGraph's textPrefix functionality.

        Args:
            value (str):

        Returns:
            P
        """
        predicate = P("textPrefix", value)

        return predicate
Example #9
0
    def textContains(value):
        """
        Implements JanusGraph's textContains functionality

        Args:
            value (str):

        Returns:
            P
        """

        predicate = P("textContains", value)
        return predicate
Example #10
0
    def textFuzzy(value):
        """
        Implements JanusGraph's textFuzzy functionality.
        Returns if the string value is similar to the given query string (based on Levenshtein edit distance)

        Args:
            value (str):

        Returns:
            bool: Returns true iff the string value is similar to the given query string.
        """

        return P("textFuzzy", value)
Example #11
0
    def textRegex(value):
        """
        Implements JanusGraph's textRegex functionality.
        Returns if the string value matches the given regular expression in its entirety

        Args:
            value (str):

        Returns:
            bool: Returns true iff the string value matches the given regular expression in its entirety.
        """

        return P("textRegex", value)
Example #12
0
    def textContainsRegex(value):
        """
        Implements JanusGraph's textContainsPrefix functionality.
        Returns true if (at least) one word inside the text string matches the given regular expression

        Args:
            value (str):

        Returns:
            bool: Returns true iff one word (at least) inside the text string matches the given regular expression.
        """

        return P("textContainsRegex", value)
Example #13
0
    def textContains(value):
        """
        Implements JanusGraph's textContains functionality.
        Returns true if (at least) one word inside the text string matches the query string

        Args:
            value (str):

        Returns:
            bool: Returns true iff one word (at least) inside the text string matches the query string.
        """

        return P("textContains", value)
Example #14
0
    def geoWithin(self, value):
        """
            Calls the Gremlin Python's P serializer to query based on geoWithin predicate.
        Args:
            value (GeoShape):

        Returns:
            P
        """

        withinP = P(self.toString(), value)

        return withinP
Example #15
0
    def geoContains(value):
        """ The method is used for JanusGraph geoContains predicate.

        GeoContains predicate holds true when one object is contained by another. The query returns the GeoShapes
        which contains the GeoShape being passed/queried.

        Args:
            value (GeoShape): The GeoShape to query for and return all results which are present inside this GeoShape

        Returns:
            bool: Returns true iff the GeoShape contains the value being queried
        """

        return P("geoContains", value)
Example #16
0
    def geoContains(self, value):
        """
            Calls the Gremlin Python's P serializer to query based on geoContains predicate.

        Args:
            value (GeoShape):

        Returns:
            P
        """

        continsP = P(self.toString(), value)

        return continsP
Example #17
0
    def geoWithin(value):
        """ The method is used for JanusGraph geoWithin predicate.

        GeoWithin predicate holds true when one object is within another. The query returns the GeoShapes which are
        present inside/within the GeoShape being passed/queried.

        Args:
            value (GeoShape): The GeoShape to query for and return all results within this this GeoShape if present.

        Returns:
            bool: Returns true iff the GeoShape is within the value being queried
        """

        return P("geoWithin", value)
Example #18
0
    def textContainsFuzzy(value):
        """
        Implements JanusGraph's textContainsFuzzy functionality.
        Returns true if (at least) one word inside the text string is similar to the query String
        (based on Levenshtein edit distance)

        Args:
            value (str):

        Returns:
            bool: Returns true iff one word inside the text string is similar to the query String.
        """

        return P("textContainsFuzzy", value)
Example #19
0
 def contains(value):
     """
     Search for a value inside a cql list/set column.
     :param value: the value to look for.
     """
     return P('contains', value)
Example #20
0
 def contains_value(value):
     """
     Search for a map value.
     :param value: the value to look for.
     """
     return P('containsValue', value)
Example #21
0
 def contains_key(value):
     """
     Search for a map key.
     :param value: the value to look for.
     """
     return P('containsKey', value)
Example #22
0
 def entry_eq(value):
     """
     Search for a map entry.
     :param value: the value to look for.
     """
     return P('entryEq', value)