Package edu.isi.karma.rep.model

Examples of edu.isi.karma.rep.model.IndividualPropertyAtom


      }
    }
   
    for (Atom atom : outputModel.getAtoms()) {
      if (atom instanceof IndividualPropertyAtom) {
        IndividualPropertyAtom propertyAtom = (IndividualPropertyAtom)atom;
       
        if (propertyAtom.getPropertyPredicate().getPrefix() != null && propertyAtom.getPropertyPredicate().getNs() != null)
          model.setNsPrefix(propertyAtom.getPropertyPredicate().getPrefix(), propertyAtom.getPropertyPredicate().getNs());
        predicateUri = propertyAtom.getPropertyPredicate().getUri();

        // creating the property resource
        Property propertyResource = model.getProperty(predicateUri);
        if (propertyResource == null)
          propertyResource = model.createProperty(predicateUri);

        argument1 = propertyAtom.getArgument1().getId();
        argument2 = propertyAtom.getArgument2().getId();
       
        Resource subjectResource = outputVariablesToResource.get(argument1);
        // maybe this variable is defined in input rdf
        if (subjectResource == null) {
          String subjectUri = inputAttValues.get(argument1);
View Full Code Here


   
    Label predicateName = new Label(predicateUri, predicateNs, predicatePrefix);
    Argument arg1 = new Argument(argument1Id, argument1Id, argument1Type);
    Argument arg2 = new Argument(argument2Id, argument2Id, argument2Type);
   
    IndividualPropertyAtom propertyAtom = new IndividualPropertyAtom(predicateName, arg1, arg2);

    return propertyAtom; 
  }
View Full Code Here

    Label featurePredicatName = new Label(geoOntology + "Feature", geoOntology, "geo");
    Label latPredicatName = new Label(geoOntology + "lat", geoOntology, "geo");
    Label lngPredicatName = new Label(geoOntology + "long", geoOntology, "geo");
   
    ClassAtom c1 = new ClassAtom(featurePredicatName, new Argument("arg1", "arg1", ArgumentType.ATTRIBUTE));
    IndividualPropertyAtom p1 = new IndividualPropertyAtom(latPredicatName,
        new Argument("arg1", "arg1", ArgumentType.ATTRIBUTE),
        new Argument("arg2", "arg2", ArgumentType.ATTRIBUTE));
    IndividualPropertyAtom p2 = new IndividualPropertyAtom(lngPredicatName,
        new Argument("arg1", "arg1", ArgumentType.ATTRIBUTE),
        new Argument("arg3", "arg3", ArgumentType.ATTRIBUTE));
//    ClassAtom c2 = new ClassAtom(featurePredicatName, new Argument("arg2", "arg2", ArgumentType.ATTRIBUTE));

    semanticModel.getAtoms().add(c1);
View Full Code Here

          r.addProperty(has_argument1, arg1);

          my_model.addProperty(has_atom, r);
        }
        else if (atom instanceof IndividualPropertyAtom) {
          IndividualPropertyAtom propertyAtom = (IndividualPropertyAtom)atom;

          Resource r = model.createResource();
          r.addProperty(rdf_type, individual_property_atom_resource);

          if (propertyAtom.getPropertyPredicate().getPrefix() != null && propertyAtom.getPropertyPredicate().getNs() != null)
            model.setNsPrefix(propertyAtom.getPropertyPredicate().getPrefix(), propertyAtom.getPropertyPredicate().getNs());
          Resource propertyName = model.createResource(propertyAtom.getPropertyPredicate().getUri());
          r.addProperty(property_predicate, propertyName);

          Resource arg1 = model.getResource(baseNS + propertyAtom.getArgument1().getAttOrVarId());
          r.addProperty(has_argument1, arg1);

          Resource arg2 = model.getResource(baseNS + propertyAtom.getArgument2().getAttOrVarId());
          r.addProperty(has_argument2, arg2);

          my_model.addProperty(has_atom, r);
        }
      }
View Full Code Here

      if (vertexIdToArgument.get(e.getSource().getId()) == null ||
          vertexIdToArgument.get(e.getTarget().getId()) == null)
        continue;
     
      Label propertyPredicate = new Label(e.getLabel().getUri(), e.getLabel().getNs(), e.getLabel().getPrefix());
      IndividualPropertyAtom propertyAtom = null;
     
//      // has_subclass is from source to target, we substitute this with a rdfs:subClassOf from target to source
//      if (propertyPredicate.getUriString().equalsIgnoreCase(ModelingParams.HAS_SUBCLASS_URI)){
//        Label subClassPredicate = new Label(ModelingParams.SUBCLASS_URI, Namespaces.OWL, Prefixes.OWL);
//        propertyAtom = new IndividualPropertyAtom(subClassPredicate,
//            vertexIdToArgument.get(e.getTarget().getId()),
//            vertexIdToArgument.get(e.getSource().getId()));
//      } else {
        propertyAtom = new IndividualPropertyAtom(propertyPredicate,
            vertexIdToArgument.get(e.getSource().getId()),
            vertexIdToArgument.get(e.getTarget().getId()));
//      }
      m.getAtoms().add(propertyAtom);
    }
View Full Code Here

      if (vertexIdToArgument.get(e.getSource().getId()) == null ||
          vertexIdToArgument.get(e.getTarget().getId()) == null)
        continue;
     
      Label propertyPredicate = new Label(e.getLabel().getUri(), e.getLabel().getNs(), e.getLabel().getPrefix());
      IndividualPropertyAtom propertyAtom = null;
     
      // has_subclass is from source to target, we substitute this with a rdfs:subClassOf from target to source
//      if (propertyPredicate.getUriString().equalsIgnoreCase(ModelingParams.HAS_SUBCLASS_URI)){
//        Label subClassPredicate = new Label(ModelingParams.SUBCLASS_URI, Namespaces.OWL, Prefixes.OWL);
//        propertyAtom = new IndividualPropertyAtom(subClassPredicate,
//            vertexIdToArgument.get(e.getTarget().getId()),
//            vertexIdToArgument.get(e.getSource().getId()));
//      } else {
        propertyAtom = new IndividualPropertyAtom(propertyPredicate,
            vertexIdToArgument.get(e.getSource().getId()),
            vertexIdToArgument.get(e.getTarget().getId()));
//      }
      m.getAtoms().add(propertyAtom);
View Full Code Here

      if (vertexIdToArgument.get(e.getSource().getId()) == null ||
          vertexIdToArgument.get(e.getTarget().getId()) == null)
        continue;

      Label propertyPredicate = new Label(e.getLabel().getUri(), e.getLabel().getNs(), e.getLabel().getPrefix());
      IndividualPropertyAtom propertyAtom = null;
     
      // has_subclass is from source to target, we substitute this with a rdfs:subClassOf from target to source
//      if (propertyPredicate.getUriString().equalsIgnoreCase(ModelingParams.HAS_SUBCLASS_URI)){
//        Label subClassPredicate = new Label(ModelingParams.SUBCLASS_URI, Namespaces.OWL, Prefixes.OWL);
//        propertyAtom = new IndividualPropertyAtom(subClassPredicate,
//            vertexIdToArgument.get(e.getTarget().getId()),
//            vertexIdToArgument.get(e.getSource().getId()));
//      } else {
        propertyAtom = new IndividualPropertyAtom(propertyPredicate,
            vertexIdToArgument.get(e.getSource().getId()),
            vertexIdToArgument.get(e.getTarget().getId()));
//      }
      m.getAtoms().add(propertyAtom);
    }
View Full Code Here

TOP

Related Classes of edu.isi.karma.rep.model.IndividualPropertyAtom

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.