Examples of listObjectsOfProperty()


Examples of com.hp.hpl.jena.ontology.OntModel.listObjectsOfProperty()

    Property sibling = ontModel.createProperty( "family:sibling" );
    Resource bob = ontModel.createResource( "family:bob" );
    assertTrue( ontModel.contains( alice, sibling, bob ) );
    assertTrue( ontModel.contains( bob, sibling, alice ) );

    assertEquals( Collections.singletonList(bob), ontModel.listObjectsOfProperty( alice, sibling ).toList() );
    assertEquals( Collections.singletonList(alice), ontModel.listObjectsOfProperty( bob, sibling ).toList() );
  }

  @Test
  public void testRepeatedVars() throws Exception {
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.InfModel.listObjectsOfProperty()

        ValidityReport report = model.validate();
        printIterator( report.getReports(), "Validation Results" );
       
        // print superclasses
        Resource c = model.getResource( ns + "MaleStudentWith3Daughters" );        
        printIterator(model.listObjectsOfProperty(c, RDFS.subClassOf), "All super classes of " + c.getLocalName());
       
        System.out.println();
    }

    public static void usageWithOntModel() {   
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.InfModel.listObjectsOfProperty()

        ValidityReport report = model.validate();
        printIterator( report.getReports(), "Validation Results" );
       
        // print superclasses
        Resource c = model.getResource( ns + "MaleStudentWith3Daughters" );        
        printIterator(model.listObjectsOfProperty(c, RDFS.subClassOf), "All super classes of " + c.getLocalName());
       
        System.out.println();
    }

    public static void usageWithOntModel() {   
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.listObjectsOfProperty()

              }
            } else if(resource.getURI() != null) {
              resourceName = resource.getURI();
            }
            System.out.println("  " + resourceName+" class:"+resource.getClass());
            NodeIterator nodes = model.listObjectsOfProperty(resource, RDF.type);
            while(nodes.hasNext()) {
              RDFNode node = nodes.nextNode();
              if(node.isResource()) {
                System.out.println("   type " + node.asResource().getURI());
              }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.listObjectsOfProperty()

              while(stmtI1.hasNext()) {
                Statement statement = stmtI1.nextStatement();             
                System.out.println("   OnlineAccount "+statement.getObject());
                if(statement.getObject().isResource()) {
                  Resource onlineAccount = statement.getObject().asResource();                 
                  NodeIterator nodess = model.listObjectsOfProperty(
                      onlineAccount, RDF.type);
                  while(nodess.hasNext()) {
                    RDFNode node = nodess.nextNode();
                    if(node.isResource()) {
                      System.out.println("      type " + node.asResource().getURI());
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.listObjectsOfProperty()

    iters = model.listSubjectsWithProperty(RDF.type);
    if (iters.hasNext()) {
        System.out.println("The database contains RDF.type for:");
        while (iters.hasNext()) {
          Resource resource = iters.nextResource();
          NodeIterator nodes = model.listObjectsOfProperty(resource, RDF.type);
          String resourceName = null;
          if(resource.getLocalName() != null) {
            resourceName = resource.getLocalName();
          } else if(resource.getId() != null) {
            if(resource.getId().getLabelString() != null) {
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.listObjectsOfProperty()

              }
            } else if(resource.getURI() != null) {
              resourceName = resource.getURI();
            }
            System.out.println("  " + resourceName+" class:"+resource.getClass());
            NodeIterator nodes = model.listObjectsOfProperty(resource, RDF.type);
            while(nodes.hasNext()) {
              RDFNode node = nodes.nextNode();
              if(node.isResource()) {
                System.out.println("   type " + node.asResource().getURI());
              }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.listObjectsOfProperty()

                System.out.println("   OnlineAccount "+statement.getObject());
                String accountURL = "";
                String accountUserName = "";
                if(statement.getObject().isResource()) {
                  Resource onlineAccount = statement.getObject().asResource();                 
                  NodeIterator nodess = model.listObjectsOfProperty(onlineAccount, RDF.type);
                  while(nodess.hasNext()) {
                    RDFNode node = nodess.nextNode();
                    if(node.isResource()) {
                      System.out.println("      type " + node.asResource().getURI());
                    }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.listObjectsOfProperty()

    iters = model.listSubjectsWithProperty(RDF.type);
    if (iters.hasNext()) {
        System.out.println("The database contains RDF.type for:");
        while (iters.hasNext()) {
          Resource resource = iters.nextResource();
          NodeIterator nodes = model.listObjectsOfProperty(resource, RDF.type);
          String resourceName = null;
          if(resource.getLocalName() != null) {
            resourceName = resource.getLocalName();
          } else if(resource.getId() != null) {
            if(resource.getId().getLabelString() != null) {
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.listObjectsOfProperty()

                        }
                    } else if(resource.getURI() != null) {
                            resourceName = resource.getURI();
                    }
                    System.out.println("  " + resourceName+" class:"+resource.getClass());
                    NodeIterator nodes = model.listObjectsOfProperty(resource, RDF.type);
                    while(nodes.hasNext()) {
                        RDFNode node = nodes.nextNode();
                        if(node.isResource()) {
                                System.out.println("   type " + node.asResource().getURI());
                        }
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.