<?xml version="1.0" encoding="GBK"?>
<rdf:RDF
    xmlns:process="http://www.daml.org/services/owl-s/1.1/Process.owl#"
    xmlns:service="http://www.daml.org/services/owl-s/1.1/Service.owl#"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:profile="http://www.daml.org/services/owl-s/1.1/Profile.owl#"
    xmlns:grounding="http://www.daml.org/services/owl-s/1.1/Grounding.owl#"
    xmlns:daml="http://www.daml.org/2001/03/daml+oil#"
    xmlns:expression="http://www.daml.org/services/owl-s/1.1/generic/Expression.owl#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:list="http://www.daml.org/services/owl-s/1.1/generic/ObjectList.owl#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
    xmlns:swrl="http://www.w3.org/2003/11/swrl#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
  <service:Service rdf:about="file:/D:/WorkSpace/CreateOWL-SFile/ontologyFiles/jiaxidianli1.owl#PayloadService">
    <service:describedBy>
      <process:CompositeProcess rdf:about="file:/D:/WorkSpace/CreateOWL-SFile/ontologyFiles/jiaxidianli1.owl#PayloadProcess"/>
    </service:describedBy>
    <service:supports>
      <grounding:WsdlGrounding rdf:about="file:/D:/WorkSpace/CreateOWL-SFile/ontologyFiles/jiaxidianli1.owl#PayloadGrounding"/>
    </service:supports>
    <service:presents>
      <profile:Profile rdf:about="file:/D:/WorkSpace/CreateOWL-SFile/ontologyFiles/jiaxidianli1.owl#PayloadProfile"/>
    </service:presents>
  </service:Service>
  <profile:Profile rdf:about="file:/D:/WorkSpace/CreateOWL-SFile/ontologyFiles/jiaxidianli1.owl#PayloadProfile">
    <profile:hasInput>
      <process:Input rdf:about="file:/D:/WorkSpace/CreateOWL-SFile/ontologyFiles/jiaxidianli1.owl#平均负荷"/>
    </profile:hasInput>
    <profile:hasOutput>
      <process:Output rdf:about="file:/D:/WorkSpace/CreateOWL-SFile/ontologyFiles/jiaxidianli1.owl#负荷预警信息"/>
    </profile:hasOutput>
    <rdfs:label>Composite Service</rdfs:label>
    <profile:hasInput>
      <process:Input rdf:about="file:/D:/WorkSpace/CreateOWL-SFile/ontologyFiles/jiaxidianli1.owl#最低负荷"/>
    </profile:hasInput>
    <profile:hasInput>
      <process:Input rdf:about="file:/D:/WorkSpace/CreateOWL-SFile/ontologyFiles/jiaxidianli1.owl#最高负荷"/>
    </profile:hasInput>
    <service:presentedBy rdf:resource="file:/D:/WorkSpace/CreateOWL-SFile/ontologyFiles/jiaxidianli1.owl#PayloadService"/>
    <profile:textDescription>Composite Service</profile:textDescription>
  </profile:Profile>
  <process:CompositeProcess rdf:about="file:/D:/WorkSpace/CreateOWL-SFile/ontologyFiles/jiaxidianli1.owl#PayloadProcess">
    <process:hasResult>
      <process:Result/>
    </process:hasResult>
    <service:describes rdf:resource="file:/D:/WorkSpace/CreateOWL-SFile/ontologyFiles/jiaxidianli1.owl#PayloadService"/>
    <process:hasInput rdf:resource="file:/D:/WorkSpace/CreateOWL-SFile/ontologyFiles/jiaxidianli1.owl#最高负荷"/>
    <process:hasInput rdf:resource="file:/D:/WorkSpace/CreateOWL-SFile/ontologyFiles/jiaxidianli1.owl#最低负荷"/>
    <process:composedOf>
      <process:Sequence>
        <process:components>
          <process:ControlConstructList>
            <list:rest rdf:resource="http://www.daml.org/services/owl-s/1.1/generic/ObjectList.owl#nil"/>
            <list:first>
              <process:Perform>
                <process:process rdf:resource="file:/D:/WorkSpace/CreateOWL-SFile/ontologyFiles/jiaxidianli1.owl#PayloadProcess"/>
              </process:Perform>
            </list:first>
          </process:ControlConstructList>
        </process:components>
      </process:Sequence>
    </process:composedOf>
    <process:hasInput rdf:resource="file:/D:/WorkSpace/CreateOWL-SFile/ontologyFiles/jiaxidianli1.owl#最低负荷"/>
    <process:hasOutput rdf:resource="file:/D:/WorkSpace/CreateOWL-SFile/ontologyFiles/jiaxidianli1.owl#负荷预警信息"/>
  </process:CompositeProcess>
  <grounding:WsdlGrounding rdf:about="file:/D:/WorkSpace/CreateOWL-SFile/ontologyFiles/jiaxidianli1.owl#PayloadGrounding">
    <service:supportedBy rdf:resource="file:/D:/WorkSpace/CreateOWL-SFile/ontologyFiles/jiaxidianli1.owl#PayloadService"/>
  </grounding:WsdlGrounding>
</rdf:RDF>
怎样才能解析出:最高负荷、最低负荷、最低负荷等

解决方案 »

  1.   

    int aj=0;
               for(Iterator ai=model.listOntProperties();ai.hasNext();){
                aj++;
                Property a1=(Property) ai.next();
                String a1s=a1.toString();
                //System.out.println(a1s.substring(a1s.lastIndexOf("#")+1));
                if(a1s.contains("type"))
                {
                for(Iterator kk=model.listResourcesWithProperty(a1);kk.hasNext();)
                {
                Object or=(Object)kk.next();
                String ors=or.toString();
                System.out.println(ors.substring(ors.lastIndexOf("#")+1));
                
                }
                }
                //String a1s=a1.toString();
                //System.out.println(a1s.substring(a1s.lastIndexOf("#")+1));
                //System.out.println(a1s);
               }
    以上为部分代码
    然后输出结果为
    List
    first
    label
    Sequence
    Profile
    Literal
    comment
    -2db65b8a:12b52bf9e64:-7ffb
    Datatype
    Input
    rest
    Container
    Statement
    isDefinedBy
    seeAlso
    Service
    object
    XMLLiteral
    Seq
    -2db65b8a:12b52bf9e64:-7ffa
    PayloadService
    domain
    nil
    Output
    平均负荷
    Bag
    负荷预警信息
    subject
    最高负荷
    range
    WsdlGrounding
    subPropertyOf
    -2db65b8a:12b52bf9e64:-7ff9
    Alt
    subClassOf
    type
    CompositeProcess
    ControlConstructList
    Resource
    Class
    最低负荷
    predicate
    Property
    Result
    PayloadProcess
    ContainerMembershipProperty
    Perform
    -2db65b8a:12b52bf9e64:-7ffc
    PayloadGrounding
    我也是刚刚接触jena
    希望有所帮助,并可以就此互相学习