0

I have this RDF description :

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:perSys="http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#">
  <rdf:Description rdf:about="http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#PervasiveContext">
      <perSys:HasNetworkContext>
      <rdf:Description rdf:about="http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#NetworkContext">
        <perSys:Rules>
          <rdf:Description rdf:about="http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#NetworkSecurity">
            <perSys:NetworkSecurityState rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Open Network</perSys:NetworkSecurityState>
            <perSys:NetworkKey rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >No Key</perSys:NetworkKey>
          </rdf:Description>
        </perSys:Rules>
        <perSys:Network>
          <rdf:Description rdf:about="http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#NetworkCharacteristics">
            <perSys:SubNetworkType rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >HSDPA</perSys:SubNetworkType>
            <perSys:NetworkState rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >CONNECTED</perSys:NetworkState>
            <perSys:Bandwidth rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
            >450</perSys:Bandwidth>
            <perSys:LinkSpeed rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
            >65</perSys:LinkSpeed>
            <perSys:NetworkAvailability rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Available</perSys:NetworkAvailability>
            <perSys:NetworkName rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >AF23_WI-FI_9F1B</perSys:NetworkName>
          </rdf:Description>
        </perSys:Network>
        <perSys:Network>
          <rdf:Description rdf:about="http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#NetworkTraficStats">
            <perSys:NumberBytesReceived rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >15599522</perSys:NumberBytesReceived>
            <perSys:NumberPacketsReceived rdf:datatype="http://www.w3.org/2001/XMLSchema#int"
            >24922</perSys:NumberPacketsReceived>
            <perSys:NumberBytesTransmited rdf:datatype="http://www.w3.org/2001/XMLSchema#int"
            >4111415</perSys:NumberBytesTransmited>
            <perSys:NumberPacketsTransmited rdf:datatype="http://www.w3.org/2001/XMLSchema#int"
            >26455</perSys:NumberPacketsTransmited>
            <perSys:NetworkUpload rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
            >0</perSys:NetworkUpload>
            <perSys:NetworkType rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Connected</perSys:NetworkType>
            <perSys:NetworkDownload rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
            >1</perSys:NetworkDownload>
            <perSys:TotalData rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
            >1</perSys:TotalData>
          </rdf:Description>
        </perSys:Network>
        <perSys:Time>
          <rdf:Description rdf:about="http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#TimeCharacteristics">
            <perSys:ConnexionTime rdf:datatype="http://www.w3.org/2001/XMLSchema#time"
            >15:00:00</perSys:ConnexionTime>
            <perSys:ConnexionDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date"
            >2015-02-06</perSys:ConnexionDate>
          </rdf:Description>
        </perSys:Time>
        <perSys:Preferences>
          <rdf:Description rdf:about="http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#PreferencesCharacteristics">
            <perSys:PreferencesName rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >preferencesName</perSys:PreferencesName>
            <perSys:PreferencesType rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >preferencesValue</perSys:PreferencesType>
          </rdf:Description>
        </perSys:Preferences>
        <perSys:Device>
          <rdf:Description rdf:about="http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#DeviceCharacteristics">
            <perSys:DeviceName rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Bekri-Laptop</perSys:DeviceName>
            <perSys:DeviceType rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Laptop</perSys:DeviceType>
          </rdf:Description>
        </perSys:Device>
        <perSys:Location>
          <rdf:Description rdf:about="http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#LocationCharacteristics">
            <perSys:SpecificLocation rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Gate 23</perSys:SpecificLocation>
            <perSys:FeatureName rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Pittsburgh International Airport</perSys:FeatureName>
          </rdf:Description>
        </perSys:Location>
      </rdf:Description>
  </perSys:HasNetworkContext>

      <perSys:HasNetworkContext>
      <rdf:Description rdf:about="http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#NetworkContext">
        <perSys:Rules>
          <rdf:Description rdf:about="http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#NetworkSecurity">
            <perSys:NetworkSecurityState rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Open Network</perSys:NetworkSecurityState>
            <perSys:NetworkKey rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >No Key</perSys:NetworkKey>
          </rdf:Description>
        </perSys:Rules>
        <perSys:Network>
          <rdf:Description rdf:about="http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#NetworkCharacteristics">
            <perSys:SubNetworkType rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >HSDPA</perSys:SubNetworkType>
            <perSys:NetworkState rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >CONNECTED</perSys:NetworkState>
            <perSys:Bandwidth rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
            >256</perSys:Bandwidth>
            <perSys:LinkSpeed rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
            >65</perSys:LinkSpeed>
            <perSys:NetworkAvailability rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Available</perSys:NetworkAvailability>
            <perSys:NetworkName rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >AF23_WI-FI_9F1B</perSys:NetworkName>
          </rdf:Description>
        </perSys:Network>
        <perSys:Network>
          <rdf:Description rdf:about="http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#NetworkTraficStats">
            <perSys:NumberBytesReceived rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >15599522</perSys:NumberBytesReceived>
            <perSys:NumberPacketsReceived rdf:datatype="http://www.w3.org/2001/XMLSchema#int"
            >24922</perSys:NumberPacketsReceived>
            <perSys:NumberBytesTransmited rdf:datatype="http://www.w3.org/2001/XMLSchema#int"
            >4111415</perSys:NumberBytesTransmited>
            <perSys:NumberPacketsTransmited rdf:datatype="http://www.w3.org/2001/XMLSchema#int"
            >26455</perSys:NumberPacketsTransmited>
            <perSys:NetworkUpload rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
            >0</perSys:NetworkUpload>
            <perSys:NetworkType rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Connected</perSys:NetworkType>
            <perSys:NetworkDownload rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
            >1</perSys:NetworkDownload>
            <perSys:TotalData rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
            >1</perSys:TotalData>
          </rdf:Description>
        </perSys:Network>
        <perSys:Time>
          <rdf:Description rdf:about="http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#TimeCharacteristics">
            <perSys:ConnexionTime rdf:datatype="http://www.w3.org/2001/XMLSchema#time"
            >15:00:00</perSys:ConnexionTime>
            <perSys:ConnexionDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date"
            >2015-02-06</perSys:ConnexionDate>
          </rdf:Description>
        </perSys:Time>
        <perSys:Preferences>
          <rdf:Description rdf:about="http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#PreferencesCharacteristics">
            <perSys:PreferencesName rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >preferencesName</perSys:PreferencesName>
            <perSys:PreferencesType rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >preferencesValue</perSys:PreferencesType>
          </rdf:Description>
        </perSys:Preferences>
        <perSys:Device>
          <rdf:Description rdf:about="http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#DeviceCharacteristics">
            <perSys:DeviceName rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Bekri-Laptop</perSys:DeviceName>
            <perSys:DeviceType rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Laptop</perSys:DeviceType>
          </rdf:Description>
        </perSys:Device>
        <perSys:Location>
          <rdf:Description rdf:about="http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#LocationCharacteristics">
            <perSys:SpecificLocation rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Gate 15</perSys:SpecificLocation>
            <perSys:FeatureName rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Pittsburgh International Airport</perSys:FeatureName>
          </rdf:Description>
        </perSys:Location>
      </rdf:Description>
  </perSys:HasNetworkContext>
   </rdf:Description>
</rdf:RDF>

I want to apply a Jena rule to select the location where the bandwidth value is equal to 450. I created this rule :

@prefix rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
@prefix xs: http://www.w3.org/2001/XMLSchema#
@prefix perSys http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#


[AdaptedModel: 
(?a ?rdf:type ?t2), 
(?b ?rdf:type ?t3), 
(?c ?rdf:type ?t4), 
(?gh perSys:Bandwidth '450'^^xsd:float)
(?klx perSys:SpecificLocation ?jkl)
->
(?klx perSys:AdaptedSpecificLocation ?jkl)]

The response normally is :

 <perSys:AdaptedSpecificLocation rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Gate 15</perSys:AdaptedSpecificLocation>

But the engine response is :

 <perSys:AdaptedSpecificLocation rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Gate 15</perSys:AdaptedSpecificLocation>
    <perSys:AdaptedSpecificLocation rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Gate 23</perSys:AdaptedSpecificLocation> 

The engine java source is :

    public void runEngine(String ruleFile, String rdfFile) {

        String net = "http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#";
   model = ModelFactory.createDefaultModel();           
      java.io.InputStream inschema =FileManager.get().open(rdfFile);    
      model.read(inschema, net);
      java.util.List rules1 = Rule.rulesFromURL(ruleFile);
      System.out.println(rules1);
      Reasoner reasoner = new GenericRuleReasoner(rules1);
      reasoner = reasoner.bindSchema(model);
      InfModel infmodel = ModelFactory.createInfModel(reasoner,model);
      Resource children = infmodel.getResource(net+"SpecificLocation");
      infmodel.write(System.out, "RDF/XML-ABBREV");
  }

Thank you to respond me.

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
Fatma Fatma
  • 63
  • 1
  • 6
  • What's the point of ?a, ?b, ?c, ?t1, ?t2, and ?t3 in your rule? They're not used in the consequent (the then-part of the rule). – Joshua Taylor Feb 10 '15 at 22:09
  • And your rule text doesn't look legal. Don't you need a colon after the prefix name? And angle brackets around the URI prefixes? – Joshua Taylor Feb 10 '15 at 22:09

2 Answers2

0

There are syntax errors in your rules, I think, but I'll assume that they're a copy and paste problem. There are two bigger issues in your rule. First, you're got a bunch of useless triples in it:

[AdaptedModel: 
(?a ?rdf:type ?t2), 
(?b ?rdf:type ?t3), 
(?c ?rdf:type ?t4), 
(?gh perSys:Bandwidth '450'^^xsd:float)
(?klx perSys:SpecificLocation ?jkl)
->
(?klx perSys:AdaptedSpecificLocation ?jkl)]

What's the point of the a, b, c, t2, t3, and t4 variables? They aren't used in the anywhere else, so they're not actually used for anything. Your rule is essentially:

[AdaptedModel: 
(?gh perSys:Bandwidth '450'^^xsd:float)
(?klx perSys:SpecificLocation ?jkl)
->
(?klx perSys:AdaptedSpecificLocation ?jkl)]

But then notice that there's a triple with ?gh, but ?gh isn't used in any of the other triple patterns. So the rule is essentially the following (as long as something has bandwidth 450):

[AdaptedModel: 
(?klx perSys:SpecificLocation ?jkl)
->
(?klx perSys:AdaptedSpecificLocation ?jkl)]

That just says that if something has a specific location, then it has the same thing as an adapted specific location. Since you've got two in the input, you have two in the output.

I'm not sure what your data is supposed to look like, so I'm not sure how you should rewrite your rule, but if you're trying to say that

If something has bandwidth 450 and specific location x then it has adapted specific location x.

you'd write it more like:

[AdaptedModel: 
(?a perSys:SpecificLocation ?b)
(?a perSys:Bandwidth '450'^^xsd:float)
->
(?a perSys:AdaptedSpecificLocation ?b)]

You need to use the same variable when you're referring to the same thing.

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • hello, thank you for your response but this rule I haven't an AdaptedSpecificLocation. – Fatma Fatma Feb 11 '15 at 13:55
  • @FatmaFatma I don't know what you're trying to say. The rule you posted in the question clearly is designed to create triples with AdaptedSpecificLocation. – Joshua Taylor Feb 11 '15 at 14:01
  • yes, the response of this rule normally is the Gate 23. but with my rule the response is Gate 23 and the Gate 15. – Fatma Fatma Feb 11 '15 at 14:28
  • Yes, that's because your rule says that "is something has X as a specific location, then it has X as an adapted specific location." You have one item that has both Gate15 an Gate23 as specific locations, so that thing ends up having both Gate23 and Gate15 as adapted specific locations. There are *two* rdf:Description elements in the RDF/XML code you gave us, but the value of rdf:about in them is the *same*, so they're describing the *same* entity. – Joshua Taylor Feb 11 '15 at 14:32
0

I change the description and I used :

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:perSys="http://localhost:8080/NetworkContextWS/onto/NetworkContextDescription#">
  <perSys:PervasiveContext>
      <perSys:HasNetworkContext>
      <perSys:NetworkContext rdf:about="n1111">
        <perSys:Rules>
          <perSys:NetworkSecurity>
            <perSys:NetworkSecurityState rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Open Network</perSys:NetworkSecurityState>
            <perSys:NetworkKey rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >No Key</perSys:NetworkKey>
            </perSys:NetworkSecurity>
        </perSys:Rules>
        <perSys:Network>
          <perSys:NetworkCharacteristics>
            <perSys:SubNetworkType rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >HSDPA</perSys:SubNetworkType>
            <perSys:NetworkState rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >CONNECTED</perSys:NetworkState>
            <perSys:Bandwidth rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
            >450</perSys:Bandwidth>
            <perSys:LinkSpeed rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
            >65</perSys:LinkSpeed>
            <perSys:NetworkAvailability rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Available</perSys:NetworkAvailability>
            <perSys:NetworkName rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >AF23_WI-FI_9F1B</perSys:NetworkName>
          </perSys:NetworkCharacteristics>
        </perSys:Network>
        <perSys:Network>
          <perSys:NetworkTraficStats>
            <perSys:NumberBytesReceived rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >15599522</perSys:NumberBytesReceived>
            <perSys:NumberPacketsReceived rdf:datatype="http://www.w3.org/2001/XMLSchema#int"
            >24922</perSys:NumberPacketsReceived>
            <perSys:NumberBytesTransmited rdf:datatype="http://www.w3.org/2001/XMLSchema#int"
            >4111415</perSys:NumberBytesTransmited>
            <perSys:NumberPacketsTransmited rdf:datatype="http://www.w3.org/2001/XMLSchema#int"
            >26455</perSys:NumberPacketsTransmited>
            <perSys:NetworkUpload rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
            >0</perSys:NetworkUpload>
            <perSys:NetworkType rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Connected</perSys:NetworkType>
            <perSys:NetworkDownload rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
            >1</perSys:NetworkDownload>
            <perSys:TotalData rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
            >1</perSys:TotalData>
          </perSys:NetworkTraficStats>
        </perSys:Network>
        <perSys:Time>
          <perSys:TimeCharacteristics>
            <perSys:ConnexionTime rdf:datatype="http://www.w3.org/2001/XMLSchema#time"
            >15:00:00</perSys:ConnexionTime>
            <perSys:ConnexionDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date"
            >2015-02-06</perSys:ConnexionDate>
          </perSys:TimeCharacteristics>
        </perSys:Time>
        <perSys:Preferences>
          <perSys:PreferencesCharacteristics>
            <perSys:PreferencesName rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >preferencesName</perSys:PreferencesName>
            <perSys:PreferencesType rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >preferencesValue</perSys:PreferencesType>
          </perSys:PreferencesCharacteristics>
        </perSys:Preferences>
        <perSys:Device>
          <perSys:DeviceCharacteristics>
            <perSys:DeviceName rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Bekri-Laptop</perSys:DeviceName>
            <perSys:DeviceType rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Laptop</perSys:DeviceType>
          </perSys:DeviceCharacteristics>
        </perSys:Device>
        <perSys:Location>
          <perSys:LocationCharacteristics>
            <perSys:SpecificLocation rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Gate 23</perSys:SpecificLocation>
            <perSys:FeatureName rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Pittsburgh International Airport</perSys:FeatureName>
           </perSys:LocationCharacteristics>
        </perSys:Location>
      </perSys:NetworkContext>
  </perSys:HasNetworkContext>

      <perSys:HasNetworkContext>
      <perSys:NetworkContext rdf:about="lm333">
        <perSys:Rules>
          <perSys:NetworkSecurity>
            <perSys:NetworkSecurityState rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Open Network</perSys:NetworkSecurityState>
            <perSys:NetworkKey rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >No Key</perSys:NetworkKey>
         </perSys:NetworkSecurity>
        </perSys:Rules>
        <perSys:Network>
          <perSys:NetworkCharacteristics>
            <perSys:SubNetworkType rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >HSDPA</perSys:SubNetworkType>
            <perSys:NetworkState rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >CONNECTED</perSys:NetworkState>
            <perSys:Bandwidth rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
            >256</perSys:Bandwidth>
            <perSys:LinkSpeed rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
            >65</perSys:LinkSpeed>
            <perSys:NetworkAvailability rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Available</perSys:NetworkAvailability>
            <perSys:NetworkName rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >AF23_WI-FI_9F1B</perSys:NetworkName>
</perSys:NetworkCharacteristics>
        </perSys:Network>
        <perSys:Network>
          <perSys:NetworkTraficStats>
            <perSys:NumberBytesReceived rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >15599522</perSys:NumberBytesReceived>
            <perSys:NumberPacketsReceived rdf:datatype="http://www.w3.org/2001/XMLSchema#int"
            >24922</perSys:NumberPacketsReceived>
            <perSys:NumberBytesTransmited rdf:datatype="http://www.w3.org/2001/XMLSchema#int"
            >4111415</perSys:NumberBytesTransmited>
            <perSys:NumberPacketsTransmited rdf:datatype="http://www.w3.org/2001/XMLSchema#int"
            >26455</perSys:NumberPacketsTransmited>
            <perSys:NetworkUpload rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
            >0</perSys:NetworkUpload>
            <perSys:NetworkType rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Connected</perSys:NetworkType>
            <perSys:NetworkDownload rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
            >1</perSys:NetworkDownload>
            <perSys:TotalData rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
            >1</perSys:TotalData>
           </perSys:NetworkTraficStats>
        </perSys:Network>
        <perSys:Time>
          <perSys:TimeCharacteristics>
            <perSys:ConnexionTime rdf:datatype="http://www.w3.org/2001/XMLSchema#time"
            >15:00:00</perSys:ConnexionTime>
            <perSys:ConnexionDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date"
            >2015-02-06</perSys:ConnexionDate>
          </perSys:TimeCharacteristics>
        </perSys:Time>
        <perSys:Preferences>
          <perSys:PreferencesCharacteristics>
            <perSys:PreferencesName rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >preferencesName</perSys:PreferencesName>
            <perSys:PreferencesType rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >preferencesValue</perSys:PreferencesType>
          </perSys:PreferencesCharacteristics>
        </perSys:Preferences>
        <perSys:Device>
          <perSys:DeviceCharacteristics>
            <perSys:DeviceName rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Bekri-Laptop</perSys:DeviceName>
            <perSys:DeviceType rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Laptop</perSys:DeviceType>
          </perSys:DeviceCharacteristics>
        </perSys:Device>
        <perSys:Location>
          <perSys:LocationCharacteristics>
            <perSys:SpecificLocation rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Gate 15</perSys:SpecificLocation>
            <perSys:FeatureName rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Pittsburgh International Airport</perSys:FeatureName>
          </perSys:LocationCharacteristics>
        </perSys:Location>
      </perSys:NetworkContext>
  </perSys:HasNetworkContext>
 </perSys:PervasiveContext>
</rdf:RDF>

And I used this rule :

[AdaptedModel: 
(?d1 rdf:type perSys:NetworkContext),
(?d2 rdf:type perSys:NetworkCharacteristics),
(?d2 perSys:Bandwidth '450'^^xsd:float)
(?d5 rdf:type perSys:LocationCharacteristics)
(?d5 perSys:SpecificLocation ?l)
->
(?d2 perSys:AdaptedContext ?l)]

But I have the same problem.

<perSys:AdaptedContext rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Gate 15</perSys:AdaptedContext>
            <perSys:AdaptedContext rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Gate 23</perSys:AdaptedContext>

Please have you an idea how to select the specific location where the bandwidth is equal to 450 using Jena rule???

Fatma Fatma
  • 63
  • 1
  • 6