Examples of Predicate


Examples of edu.isi.karma.kr2rml.Predicate

            RefObjectMap refObjMap = new RefObjectMap(RefObjectMap.getNewRefObjectMapId(), objTrMap);
            ObjectMap objMap = new ObjectMap(target.getId(), refObjMap);
            poMap.setObject(objMap);
           
            // Create the predicate
            Predicate pred = new Predicate(olink.getId());
           
            // Check if a specialization link exists
            LabeledLink specializedEdge = getSpecializationLinkIfExists(olink, node);
            if (specializedEdge != null) {
              Node specializedEdgeTarget = specializedEdge.getTarget();
              if (specializedEdgeTarget instanceof ColumnNode) {
                String columnName = translator.getColumnNameForHNodeId(((ColumnNode) specializedEdgeTarget).getHNodeId());
                ColumnTemplateTerm cnTerm =
                    new ColumnTemplateTerm(columnName);
                pred.getTemplate().addTemplateTermToSet(cnTerm);
              }
            } else {
              pred.getTemplate().addTemplateTermToSet(
                  new StringTemplateTerm(olink.getLabel().getUri(), true));
            }
            poMap.setPredicate(pred);
            if (generateInverse)
              addInversePropertyIfExists(subjMap, poMap, olink, subjTrMap);
           
            // Add the links in the graph links data structure
            TriplesMapLink link = new TriplesMapLink(subjTrMap, objTrMap, poMap)
            r2rmlMapping.getAuxInfo().getTriplesMapGraph().addLink(link);
          }
         
          else if(target instanceof LiteralNode) {
            LiteralNode lnode = (LiteralNode) target;
           
            //Create the object
            TemplateTermSet termSet = new TemplateTermSet();
            StringTemplateTerm literalTerm = new StringTemplateTerm(lnode.getValue(), lnode.isUri());
            termSet.addTemplateTermToSet(literalTerm);
           
            StringTemplateTerm rdfLiteralTypeTerm = new StringTemplateTerm(lnode.getLabel().getUri(), true);
            TemplateTermSet rdfLiteralTypeTermSet = new TemplateTermSet();
            rdfLiteralTypeTermSet.addTemplateTermToSet(rdfLiteralTypeTerm);
           
            ObjectMap objMap = new ObjectMap(target.getId(), termSet, rdfLiteralTypeTermSet);
            poMap.setObject(objMap);
           
            // Create the predicate
            Predicate pred = new Predicate(olink.getId());
            pred.getTemplate().addTemplateTermToSet(
                  new StringTemplateTerm(olink.getLabel().getUri(), true));
           
            poMap.setPredicate(pred);
            if (generateInverse)
              addInversePropertyIfExists(subjMap, poMap, olink, subjTrMap);
           
          }
         
          // Create a data property map
          else if(target instanceof ColumnNode) {
            // Create the object map
            ColumnNode cnode = (ColumnNode) target;
            String hNodeId = cnode.getHNodeId();
            String columnName = translator.getColumnNameForHNodeId(hNodeId);
            ColumnTemplateTerm cnTerm = new ColumnTemplateTerm(columnName);
            TemplateTermSet termSet = expandColumnTemplateTermForPyTransforms(
                hNodeId, cnTerm);
           
            String rdfLiteralUri =   cnode.getRdfLiteralType() == null? "" : cnode.getRdfLiteralType().getUri();
            StringTemplateTerm rdfLiteralTypeTerm = new StringTemplateTerm(rdfLiteralUri, true);
            TemplateTermSet rdfLiteralTypeTermSet = new TemplateTermSet();
            rdfLiteralTypeTermSet.addTemplateTermToSet(rdfLiteralTypeTerm);

            ObjectMap objMap = new ObjectMap(hNodeId, termSet, rdfLiteralTypeTermSet);
            poMap.setObject(objMap);
           
            // Create the predicate
            Predicate pred = new Predicate(olink.getId());
           
            // Check if a specialization link exists
            LabeledLink specializedEdge = getSpecializationLinkIfExists(olink, node);
            if (specializedEdge != null) {
              Node specializedEdgeTarget = specializedEdge.getTarget();
              if (specializedEdgeTarget instanceof ColumnNode) {
                String targetColumnName = translator.getColumnNameForHNodeId(((ColumnNode) specializedEdgeTarget).getHNodeId());
                ColumnTemplateTerm cnsplTerm =
                    new ColumnTemplateTerm(targetColumnName);
                pred.getTemplate().addTemplateTermToSet(cnsplTerm);
              }
            } else {
              pred.getTemplate().addTemplateTermToSet(
                  new StringTemplateTerm(olink.getLabel().getUri(), true));
            }
            poMap.setPredicate(pred);
           
            // Save link from the columnName to the its PredicateObjectMap in the auxiliary information
View Full Code Here

Examples of io.undertow.predicate.Predicate

        String[] lines = contents.split("\\n");
        final List<PredicatedHandler> wrappers = new ArrayList<PredicatedHandler>();

        for (String line : lines) {
            if (line.trim().length() > 0) {
                Predicate predicate;
                HandlerWrapper handler;
                String[] parts = line.split("->");
                if (parts.length == 2) {
                    predicate = PredicateParser.parse(parts[0], classLoader);
                    handler = HandlerParser.parse(parts[1], classLoader);
View Full Code Here

Examples of jade.content.Predicate

    if (!asynchNotificationRequired) {
      theDF.removePendingRequest(action);
      // The requested action has been completed. Prepare the notification
      ACLMessage notification = request.createReply();
      notification.setPerformative(ACLMessage.INFORM);
      Predicate p = null;
      if (result != null) {
        // The action produced a result
        p = new Result(slAction, result);
      }
      else {
View Full Code Here

Examples of javaff.data.strips.Predicate

 
   public void makeInstants()
  {
     PredicateSymbol ps = new PredicateSymbol("i"+name);
     Predicate j = new Predicate(ps);
     j.addParameters(params);
     dummyJoin = j;

     PredicateSymbol ps2 = new PredicateSymbol("g"+name);
     Predicate g = new Predicate(ps2);
     g.addParameters(params);
     dummyGoal = g;
    
     startAction = new UngroundInstantAction();
     startAction.name = new OperatorName(name.toString()+"_START");
     startAction.params = params;
View Full Code Here

Examples of javax.persistence.criteria.Predicate

    EntityTransaction tx = em.getTransaction();
    tx.begin();
    CriteriaBuilder cb = em.getCriteriaBuilder();
    CriteriaQuery<Configuration> cq = cb.createQuery(Configuration.class);
    Root<Configuration> c = cq.from(Configuration.class);
    Predicate condition = cb.equal(c.get("deleted"), "false");
    cq.where(condition);
    TypedQuery<Configuration> q = em.createQuery(cq);
    List<Configuration> result = q.getResultList();
    try {
      tx.commit();
View Full Code Here

Examples of javax.sql.rowset.Predicate

    public void testCreateShared() throws Exception {
        FilteredRowSet filteredRowSet = newFilterRowSet();
        rs = st.executeQuery("SELECT * FROM USER_INFO");
        filteredRowSet.populate(rs);

        Predicate range = new RangeOne();
        filteredRowSet.setFilter(range);

        FilteredRowSet copyFilteredRs = (FilteredRowSet) filteredRowSet
                .createShared();
        assertSame(range, copyFilteredRs.getFilter());
View Full Code Here

Examples of jfun.yan.util.Predicate

    verifyLinkedHashMap((LinkedHashMap)hmap);
    final Component bad_hash = Components.hashmap(
        new String[]{"a","b"},
        new Creator[]{
            Components.useKey("a").withState("hello"),
            Components.useState(new Predicate(){
              public boolean isObject(Object obj){
                return false;
              }
            })
        }
View Full Code Here

Examples of jp.ac.kobe_u.cs.prolog.lang.Predicate

class PRED_$process_order_2_2 extends PRED_$process_order_2 {
    public Predicate exec(Prolog engine) {
    // '$process_order'(end_of_file,A):-!
        Term a1, a2;
        Predicate cont;
        a1 = engine.aregs[1];
        a2 = engine.aregs[2];
        cont = engine.cont;
    // '$process_order'(end_of_file,A):-['$neck_cut']
        a1 = a1.dereference();
View Full Code Here

Examples of lcmc.common.domain.Predicate

                        Tools.getString("HostBrowser.CRM.StandByOff"),
                        HostInfo.HOST_STANDBY_OFF_ICON,
                        ClusterBrowser.STARTING_PTEST_TOOLTIP,
                        new AccessMode(AccessMode.OP, AccessMode.NORMAL),
                        new AccessMode(AccessMode.OP, AccessMode.NORMAL))
                        .predicate(new Predicate() {
                            @Override
                            public boolean check() {
                                return !hostInfo.isStandby(runMode);
                            }
                        })
                        .enablePredicate(new EnablePredicate() {
                            @Override
                            public String check() {
                                if (!hostInfo.getHost().isCrmStatusOk()) {
                                    return HostInfo.NO_PCMK_STATUS_STRING;
                                }
                                return null;
                            }
                        })
                        .addAction(new MenuAction() {
                            @Override
                            public void run(final String text) {
                                final Host dcHost = hostInfo.getBrowser().getClusterBrowser().getDCHost();
                                if (hostInfo.isStandby(runMode)) {
                                    CRM.standByOff(dcHost, hostInfo.getHost(), runMode);
                                } else {
                                    CRM.standByOn(dcHost, hostInfo.getHost(), runMode);
                                }
                            }
                        });
        final ClusterBrowser cb = hostInfo.getBrowser().getClusterBrowser();
        if (cb != null) {
            final ButtonCallback standbyItemCallback = cb.new ClMenuItemCallback(hostInfo.getHost())
                    .addAction(new CallbackAction() {
                        @Override
                        public void run(final Host dcHost) {
                            if (hostInfo.isStandby(Application.RunMode.LIVE)) {
                                CRM.standByOff(dcHost, hostInfo.getHost(), Application.RunMode.TEST);
                            } else {
                                CRM.standByOn(dcHost, hostInfo.getHost(), Application.RunMode.TEST);
                            }
                        }
                    });
            hostInfo.addMouseOverListener(standbyItem, standbyItemCallback);
        }
        items.add(standbyItem);

        /* Migrate all services from this host. */
        final MyMenuItem allMigrateFromItem =
                menuFactory.createMenuItem(Tools.getString("HostInfo.CRM.AllMigrateFrom"),
                        HostInfo.HOST_STANDBY_ICON,
                        ClusterBrowser.STARTING_PTEST_TOOLTIP,
                        new AccessMode(AccessMode.OP, AccessMode.NORMAL),
                        new AccessMode(AccessMode.OP, AccessMode.NORMAL))
                        .enablePredicate(new EnablePredicate() {
                            @Override
                            public String check() {
                                if (!hostInfo.getHost().isCrmStatusOk()) {
                                    return HostInfo.NO_PCMK_STATUS_STRING;
                                }
                                if (hostInfo.getBrowser().getClusterBrowser().getExistingServiceList(null).isEmpty()) {
                                    return "there are no services to migrate";
                                }
                                return null;
                            }
                        })
                        .addAction(new MenuAction() {
                            @Override
                            public void run(final String text) {
                                for (final ServiceInfo si : cb.getExistingServiceList(null)) {
                                    if (!si.isConstraintPlaceholder() && si.getGroupInfo() == null && si.getCloneInfo() == null) {
                                        final List<String> runningOnNodes = si.getRunningOnNodes(Application.RunMode.LIVE);
                                        if (runningOnNodes != null && runningOnNodes.contains(hostInfo.getHost().getName())) {
                                            final Host dcHost = hostInfo.getHost();
                                            si.migrateFromResource(dcHost, hostInfo.getHost().getName(), Application.RunMode.LIVE);
                                        }
                                    }
                                }
                            }
                        });
        if (cb != null) {
            final ButtonCallback allMigrateFromItemCallback = cb.new ClMenuItemCallback(hostInfo.getHost())
                    .addAction(new CallbackAction() {
                        @Override
                        public void run(final Host dcHost) {
                            for (final ServiceInfo si : cb.getExistingServiceList(null)) {
                                if (!si.isConstraintPlaceholder() && si.getGroupInfo() == null) {
                                    final List<String> runningOnNodes = si.getRunningOnNodes(Application.RunMode.LIVE);
                                    if (runningOnNodes != null && runningOnNodes.contains(hostInfo.getHost().getName())) {
                                        si.migrateFromResource(dcHost, hostInfo.getHost().getName(), Application.RunMode.TEST);
                                    }
                                }
                            }
                        }
                    });
            hostInfo.addMouseOverListener(allMigrateFromItem, allMigrateFromItemCallback);
        }
        items.add(allMigrateFromItem);
        /* Stop corosync/openais. */
        final MyMenuItem stopCorosyncItem =
                menuFactory.createMenuItem(Tools.getString("HostInfo.StopCorosync"),
                        HostInfo.HOST_STOP_COMM_LAYER_ICON,
                        ClusterBrowser.STARTING_PTEST_TOOLTIP,

                        Tools.getString("HostInfo.StopOpenais"),
                        HostInfo.HOST_STOP_COMM_LAYER_ICON,
                        ClusterBrowser.STARTING_PTEST_TOOLTIP,

                        new AccessMode(AccessMode.ADMIN, AccessMode.ADVANCED),
                        new AccessMode(AccessMode.ADMIN, AccessMode.NORMAL))
                        .enablePredicate(new EnablePredicate() {
                            @Override
                            public String check() {
                                final Host h = hostInfo.getHost();
                                if (!h.isInCluster()) {
                                    return NOT_IN_CLUSTER;
                                }
                                return null;
                            }
                        })
                        .predicate(new Predicate() {
                            @Override
                            public boolean check() {
                    /* when both are running it's openais. */
                                return hostInfo.getHost().isCorosyncRunning() && !hostInfo.getHost().isOpenaisRunning();
                            }
View Full Code Here

Examples of lupos.rif.datatypes.Predicate

          ((Constant) this.termParams.get(1)).getLiteral():
          (Literal)((External) this.termParams.get(1)).evaluate(new BindingsMap());

      return new Triple(subject, predicate, object);
    } else {
      final Predicate pred = new Predicate();
      pred.setName(((Constant) this.termName).getLiteral());
      for (final IExpression expr : this.termParams) {
        pred.getParameters().add(  (expr instanceof Constant)?
                      ((Constant) expr).getLiteral():
                      (Literal)((External) expr).evaluate(new BindingsMap()));
      }
      return pred;
    }
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.