!C99Shell v. 1.0 pre-release build #16!

Software: Apache/2.0.54 (Fedora). PHP/5.0.4 

uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 

uid=48(apache) gid=48(apache) groups=48(apache)
context=system_u:system_r:httpd_sys_script_t
 

Safe-mode: OFF (not secure)

/usr/lib/python2.4/site-packages/Ft/Rdf/Inference/   drwxr-xr-x
Free 3.66 GB of 27.03 GB (13.55%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     Query.py (3.3 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
########################################################################
#
# File Name:            Query.py
#
# Documentation:        http://docs.4suite.org/4Rdf/Inference/Query.py.html
#
"""

WWW: http://4suite.org/4RDF         e-mail: support@4suite.org

Copyright (c) 1999 Fourthought Inc, USA.   All Rights Reserved.
See  http://4suite.org/COPYRIGHT  for license and copyright information
"""
from Ft.Rdf.Statement import Statement
import Common
class Query:
    def __init__(self, id_,arguments):
        self.id = id_
        self.arguments = arguments
        self.type = Common.ArgumentTypes.QUERY
        return
    def execute(self,infEng,context):
        return self.query(infEng,context)

    def _4rdf_dump(self,indent=0):

        iStr = "\t" * indent
        rt = iStr + "<ril:query id='%s'>\n" % self.id
        for arg in self.arguments:
            rt = rt + arg._4rdf_dump(indent+1)
        rt = rt + iStr + '</ril:query>\n'
        return rt

class SingleQuery(Query):
    '''
    Complete and RDF triple with the argument as the subject and the object ignored
    '''

    def query(self, infEng, context):
        if self.arguments[0].type == Common.ArgumentTypes.SKOLEM_VARIABLE and self.arguments[0].execute(infEng,context) is None:
            #All instances of this predicate
            triples = infEng.complete('', self.id, '')
            rt = map(lambda x: (x.subject,x.predicate,x.object), triples)
            return rt
        #This is a filter based on the arguments
        args = self.arguments[0].execute(infEng,context)
        rt = []
        for arg in args:
           triples = infEng.complete(arg,self.id,'')
            rt = rt + map(lambda x:(x.subject,x.predicate,x.object),triples)
        return rt


class DualQuery(Query):
    '''
    A Complete with 2 arguments
    '''

    def query(self, infEng, context):

        #Use Cases
        #Foo($X,$X)
        #Foo($X,$Y)
        #Foo($X,"")
        #Foo("",$X)
        #Foo("","")

        arg0 = self.arguments[0]
        arg1 = self.arguments[1]
        args0 = arg0.execute(infEng,context)
        args1 = arg1.execute(infEng,context)
        
        results = []

        if arg0.type == Common.ArgumentTypes.SKOLEM_VARIABLE and args0 is None:
            #Cases 1-3
            if arg1.type == Common.ArgumentTypes.SKOLEM_VARIABLE and args0 is None:
                #Cases 1-2
                results = map(lambda x:(x.subject,x.predicate,x.object),infEng.complete('',self.id,''))
                if arg0.name == arg1.name:
                    #Case 1
                    results = filter(lambda x:x[0] == x[2],results)
            else:
                #Case 3
                for arg in args1:
                    triples = infEng.complete('',self.id,arg)
                    results = results + map(lambda x:(x.subject,x.predicate,x.object),triples)
        elif arg1.type == Common.ArgumentTypes.SKOLEM_VARIABLE and args1 is None:
            #Case 4
            for arg in args0:
                triples = infEng.complete(arg,self.id,'')
                results = results + map(lambda x:(x.subject,x.predicate,x.object),triples)
        else:
            #Case 5
            for a1 in args0:
                for a2 in args1:
                    if infEng.contains(Statement(a1,self.id,a2)):
                        results.append((a1,self.id,a2))
        return results


:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0039 ]--