Examples of parseProgram()


Examples of org.apache.marmotta.kiwi.reasoner.parser.KWRLProgramParserBase.parseProgram()

        KiWiReasoningConnection connection = rpersistence.getConnection();
        try {
            List<Program> programs = new ArrayList<Program>();
            for(String name : new String[] {"test-001", "test-002", "test-003", "test-004"}) {
                KWRLProgramParserBase parser = new KWRLProgramParser(repository.getValueFactory(), this.getClass().getResourceAsStream(name+".kwrl"));
                Program p = parser.parseProgram();
                p.setName(name);
                connection.storeProgram(p);
                connection.commit();

                programs.add(p);
View Full Code Here

Examples of org.apache.marmotta.kiwi.reasoner.parser.KWRLProgramParserBase.parseProgram()

        // store a program, very simple transitive and symmetric rules:
        // ($1 ex:property $2), ($2 ex:property $3) -> ($1 ex:property $3)
        // ($1 ex:symmetric $2) -> ($2 ex:symmetric $1)
        KWRLProgramParserBase parser = new KWRLProgramParser(repository.getValueFactory(), this.getClass().getResourceAsStream("simple.kwrl"));
        Program p = parser.parseProgram();
        p.setName("simple");

        KiWiReasoningConnection connection = rpersistence.getConnection();
        try {
            // should not throw an exception and the program should have a database ID afterwards
View Full Code Here

Examples of org.apache.stanbol.entityhub.ldpath.EntityhubLDPath.parseProgram()

        String ldPathProgram = getProgramByName(programName);
        ValueFactory vf = InMemoryValueFactory.getInstance();
        EntityhubLDPath ldPath = new EntityhubLDPath(backend, vf);
        Program<Object> program = null;
        try {
            program = ldPath.parseProgram(LDPathUtils.constructReader(ldPathProgram));
        } catch (LDPathParseException e) {
            String msg = "Should never happen!!!!! Cannot parse the already stored LDPath program.";
            logger.error(msg, e);
        } catch (LDPathException e) {
            String msg = "Should never happen!!!!! Cannot parse the already stored LDPath program.";
View Full Code Here

Examples of org.apache.stanbol.entityhub.ldpath.EntityhubLDPath.parseProgram()

        String ldPathProgram = getProgramByName(programName);
        ValueFactory vf = InMemoryValueFactory.getInstance();
        EntityhubLDPath ldPath = new EntityhubLDPath(backend, vf);
        Program<Object> program = null;
        try {
            program = ldPath.parseProgram(LDPathUtils.constructReader(ldPathProgram));
        } catch (LDPathParseException e) {
            logger.error("Should never happen!!!!!", e);
            return Collections.emptyMap();
        }
View Full Code Here

Examples of org.apache.stanbol.entityhub.ldpath.EntityhubLDPath.parseProgram()

                                 String ldpath,
                                 Set<String> contexts ) throws LDPathParseException {
        MGraph data = new IndexedMGraph();
        RdfValueFactory vf = new RdfValueFactory(data);
        EntityhubLDPath ldPath = new EntityhubLDPath(backend,vf);
        Program<Object> program = ldPath.parseProgram(getReader(ldpath));
        if(log.isDebugEnabled()){
            log.debug("Execute on Context(s) '{}' LDPath program: \n{}",
                contexts,program.getPathExpression(backend));
        }
        /*
 
View Full Code Here

Examples of org.apache.stanbol.entityhub.ldpath.EntityhubLDPath.parseProgram()

            //NOTE: calling execute(..) an this parseLdPath or even the
            //ldpathProgram will result in UnsupportedOperationException
            //but parsing is OK
            EntityhubLDPath parseLdPath = new EntityhubLDPath(parseBackend, valueFactory);
            try {
                ldpathProgram = parseLdPath.parseProgram(new StringReader(ldpathProgramStr));
            } catch (LDPathParseException e) {
                log.error("Unable to parse LDPath pogram: \n {}", ldpathProgramStr);
                throw new ConfigurationException(DereferenceConstants.DEREFERENCE_ENTITIES_LDPATH,
                    "Unable to parse configured LDPath program ", e);
            }
View Full Code Here

Examples of org.apache.stanbol.entityhub.ldpath.EntityhubLDPath.parseProgram()

                                 String ldpath,
                                 Set<String> contexts ) throws LDPathParseException {
        MGraph data = new IndexedMGraph();
        RdfValueFactory vf = new RdfValueFactory(data);
        EntityhubLDPath ldPath = new EntityhubLDPath(backend,vf);
        Program<Object> program = ldPath.parseProgram(getReader(ldpath));
        if(log.isDebugEnabled()){
            log.debug("Execute on Context(s) '{}' LDPath program: \n{}",
                contexts,program.getPathExpression(backend));
        }
        /*
 
View Full Code Here

Examples of org.apache.stanbol.entityhub.ldpath.EntityhubLDPath.parseProgram()

        String ldPathProgram = getProgramByName(programName);
        ValueFactory vf = InMemoryValueFactory.getInstance();
        EntityhubLDPath ldPath = new EntityhubLDPath(backend, vf);
      Program<Object> program = null;
        try {
            program = ldPath.parseProgram(LDPathUtils.constructReader(ldPathProgram));
        } catch (LDPathParseException e) {
          String msg = "Should never happen!!!!! Cannot parse the already stored LDPath program.";
            logger.error(msg, e);
        } catch (LDPathException e) {
          String msg = "Should never happen!!!!! Cannot parse the already stored LDPath program.";
View Full Code Here

Examples of org.apache.stanbol.entityhub.ldpath.EntityhubLDPath.parseProgram()

        String ldPathProgram = getProgramByName(programName);
        ValueFactory vf = InMemoryValueFactory.getInstance();
        EntityhubLDPath ldPath = new EntityhubLDPath(backend, vf);
        Program<Object> program = null;
        try {
            program = ldPath.parseProgram(LDPathUtils.constructReader(ldPathProgram));
        } catch (LDPathParseException e) {
            logger.error("Should never happen!!!!!", e);
            return Collections.emptyMap();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.