Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply rename 005, adapt to change in sockets #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

package won.transport.taxi.bot.action;
import won.protocol.vocabulary.WONMATCH;

import org.apache.commons.lang3.StringUtils;
import org.apache.jena.query.Dataset;
Expand All @@ -35,7 +36,6 @@
import won.protocol.exception.WonMessageBuilderException;
import won.protocol.message.WonMessage;
import won.protocol.message.WonMessageBuilder;
import won.protocol.model.AtomContentPropertyType;
import won.protocol.model.AtomGraphType;
import won.protocol.service.WonNodeInformationService;
import won.protocol.util.DefaultAtomModelWrapper;
Expand Down Expand Up @@ -120,14 +120,16 @@ private Model createFactoryOfferFromTemplate(EventListenerContext ctx, URI facto

DefaultAtomModelWrapper atomModelWrapper = new DefaultAtomModelWrapper(ctx.getWonNodeInformationService().generateAtomURI(ctx.getNodeURISource().getNodeURI()).toString());

atomModelWrapper.setTitle(AtomContentPropertyType.IS, connectTitle);
atomModelWrapper.setTitle(connectTitle);
//atomModelWrapper.setDescription(AtomContentPropertyType.IS, "This is a automatically created atom by the TaxiBot");
atomModelWrapper.addFlag(WON.NoHintForCounterpart);
atomModelWrapper.addFlag(WON.NoHintForMe);
atomModelWrapper.addFlag(WONMATCH.NoHintForCounterpart);
atomModelWrapper.addFlag(WONMATCH.NoHintForMe);
atomModelWrapper.setShapesGraphReference(STUB_SHAPES_URI);

for(URI socket : sockets){
atomModelWrapper.addSocketUri(socket.toString());
int i = 1;
for (URI socket : sockets) {
atomModelWrapper.addSocket("#socket" + i, socket.toString());
i++;
}

return atomModelWrapper.copyAtomModel(AtomGraphType.ATOM);
Expand All @@ -147,8 +149,8 @@ private WonMessage createWonMessage(

AtomModelWrapper atomModelWrapper = new AtomModelWrapper(atomModel, null);

atomModelWrapper.addFlag(WON.NoHintForMe);
atomModelWrapper.addFlag(WON.NoHintForCounterpart);
atomModelWrapper.addFlag(WONMATCH.NoHintForMe);
atomModelWrapper.addFlag(WONMATCH.NoHintForCounterpart);

RdfUtils.replaceBaseURI(atomModel, atomURI.toString());

Expand Down
32 changes: 17 additions & 15 deletions won-taxi-bot/src/main/resources/FactoryAtoms/taxi-service.trig
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@prefix con: <https://w3id.org/won/content#> .
@prefix match: <https://w3id.org/won/matching#> .
@prefix msg: <https://w3id.org/won/message#> .
@prefix conn: <https://localhost:8443/won/resource/connection/> .
@prefix atom: <https://localhost:8443/won/resource/atom/> .
Expand Down Expand Up @@ -27,20 +29,20 @@
{
olntest:taxiService1
a won:Atom ;
won:flag won:NoHintForCounterpart ;
match:flag match:NoHintForCounterpart ;
won:hasSearchString "search-lift" ;
won:is [ dc:description "next 10 minutes" ;
dc:title "Taxi in Wien"@de ;
dc:description "Biete Taxidienstleistungen im Raum Wien und Umgebung"@de ;
dc:title "Taxi in Vienna"@en ;
dc:description "Offering taxi services in Vienna and around"@en ;
won:tag "Taxi", "PersonenTransport"@de, "People transport"@en ;
con:tag "Taxi", "PersonenTransport"@de, "People transport"@en ;
won:location [ a s:Place ;
won:boundingBox [ won:northWestCorner [ a s:GeoCoordinates ;
con:boundingBox [ con:northWestCorner [ a s:GeoCoordinates ;
s:latitude "48.199528" ;
s:longitude "16.355209"
] ;
won:southEastCorner [ a s:GeoCoordinates ;
con:southEastCorner [ a s:GeoCoordinates ;
s:latitude "48.218489" ;
s:longitude "16.384895"
]
Expand All @@ -53,8 +55,8 @@
s:name "Vienna, Austria"@en
]
] ;
won:seeks [
won:seeks [
match:seeks [
match:seeks [
dc:title "Taxi";
won:location [
s:geo [
Expand All @@ -66,8 +68,8 @@
];
]
];
won:seeks [
won:seeks [
match:seeks [
match:seeks [
dc:description "Taxi";
won:location [
s:geo [
Expand All @@ -79,9 +81,9 @@
];
]
];
won:seeks [
won:seeks [
won:tag "Taxi";
match:seeks [
match:seeks [
con:tag "Taxi";
won:location [
s:geo [
a s:GeoCoordinates ;
Expand All @@ -92,13 +94,13 @@
];
]
];
won:seeks [
won:seeks [
match:seeks [
match:seeks [
dc:title "Taxi Wien"
]
];
won:seeks [
won:seeks [
match:seeks [
match:seeks [
dc:description "Taxi Wien"
]
].
Expand Down
36 changes: 19 additions & 17 deletions won-taxi-bot/src/main/resources/FactoryAtoms/taxi-service.ttl
Original file line number Diff line number Diff line change
@@ -1,43 +1,45 @@
@prefix con: <https://w3id.org/won/content#> .
@prefix match: <https://w3id.org/won/matching#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix won: <https://w3id.org/won/core#> .
@prefix s: <http://schema.org/> .
@prefix oln-test: <http://sat.researchstudio.at/oln/test/> .
oln-test:taxiService1
a won:Atom;
a s:TaxiService;
won:flag won:NoHintForCounterpart;
match:flag match:NoHintForCounterpart;
won:is [
dc:title "Taxi in Wien"@de;
dc:description "Biete Taxidienstleistungen im Raum Wien und Umgebung"@de;
dc:title "Taxi in Vienna"@en;
dc:description "Offering taxi services in Vienna and around"@en;
won:tag "Taxi", "PersonenTransport"@de, "People transport"@en;
con:tag "Taxi", "PersonenTransport"@de, "People transport"@en;
won:location [
a s:Place ;
won:boundingBox [
won:northWestCorner [
con:boundingBox [
con:northWestCorner [
a s:GeoCoordinates ;
s:latitude "48.199528" ;
s:longitude "16.355209"
] ;
won:southEastCorner [
con:southEastCorner [
a s:GeoCoordinates ;
s:latitude "48.218489" ;
s:longitude "16.384895"
]
] ;
s:geo [
a s:GeoCoordinates ;
won:geoSpatial "48.220210#16.371216"^^<http://www.bigdata.com/rdf/geospatial/literals/v1#lat-lon> ;
con:geoSpatial "48.220210#16.371216"^^<http://www.bigdata.com/rdf/geospatial/literals/v1#lat-lon> ;
s:latitude "48.220210" ;
s:longitude "16.371216"
] ;
s:name "Wien, Österreich"@de;
s:name "Vienna, Austria"@en
]
];
won:seeks [
won:seeks [
match:seeks [
match:seeks [
dc:title "Taxi";
won:location [
s:geo [
Expand All @@ -49,8 +51,8 @@ oln-test:taxiService1
];
]
];
won:seeks [
won:seeks [
match:seeks [
match:seeks [
dc:description "Taxi";
won:location [
s:geo [
Expand All @@ -62,9 +64,9 @@ oln-test:taxiService1
];
]
];
won:seeks [
won:seeks [
won:tag "Taxi";
match:seeks [
match:seeks [
con:tag "Taxi";
won:location [
s:geo [
a s:GeoCoordinates ;
Expand All @@ -74,13 +76,13 @@ oln-test:taxiService1
s:name "Wien"
];
];
won:seeks [
won:seeks [
match:seeks [
match:seeks [
dc:title "Taxi Wien"
]
];
won:seeks [
won:seeks [
match:seeks [
match:seeks [
dc:description "Taxi Wien"
]
];
Expand Down
5 changes: 3 additions & 2 deletions won-taxi-bot/src/main/resources/temp/fromLocationRetrieval.rq
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
PREFIX con: <https://w3id.org/won/content#>
prefix s: <http://schema.org/>
prefix won: <https://w3id.org/won/core#>

Select ?lat ?lon

where {
?main a s:Place;
won:boundingBox ?boundingBox .
?boundingBox won:northWestCorner ?geoCoordinates .
con:boundingBox ?boundingBox .
?boundingBox con:northWestCorner ?geoCoordinates .
?geoCoordinates s:latitude ?lat;
s:longitude ?lon.
}
5 changes: 3 additions & 2 deletions won-taxi-bot/src/main/resources/temp/goals.trig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@prefix con: <https://w3id.org/won/content#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix s: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
Expand All @@ -23,13 +24,13 @@ ex2:p2g-shapes {
sh:closed false ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [
sh:path (won:boundingBox won:southEastCorner);
sh:path (con:boundingBox con:southEastCorner);
sh:class s:GeoCoordinates ;
sh:minCount 0;
sh:maxCount 1;
] ;
sh:property [
sh:path (won:boundingBox won:northWestCorner);
sh:path (con:boundingBox con:northWestCorner);
sh:class s:GeoCoordinates ;
sh:minCount 1;
sh:maxCount 1;
Expand Down
5 changes: 3 additions & 2 deletions won-taxi-bot/src/main/resources/temp/goals_withoutmax.trig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@prefix con: <https://w3id.org/won/content#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix s: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
Expand All @@ -22,12 +23,12 @@ ex2:p2g-shapes {
sh:closed false ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [
sh:path (won:boundingBox won:southEastCorner);
sh:path (con:boundingBox con:southEastCorner);
sh:class s:GeoCoordinates ;
sh:minCount 0;
] ;
sh:property [
sh:path (won:boundingBox won:northWestCorner);
sh:path (con:boundingBox con:northWestCorner);
sh:class s:GeoCoordinates ;
sh:minCount 1;
] ;
Expand Down
5 changes: 3 additions & 2 deletions won-taxi-bot/src/main/resources/temp/toLocationRetrieval.rq
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
PREFIX con: <https://w3id.org/won/content#>
prefix s: <http://schema.org/>
prefix won: <https://w3id.org/won/core#>

Select ?lat ?lon

where {
?main a s:Place;
won:boundingBox ?boundingBox .
?boundingBox won:southEastCorner ?geoCoordinates .
con:boundingBox ?boundingBox .
?boundingBox con:southEastCorner ?geoCoordinates .
?geoCoordinates s:latitude ?lat;
s:longitude ?lon.
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
package won.transport.taxi.bot.client;

import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import won.transport.taxi.bot.client.entity.Parameter.*;

import won.transport.taxi.bot.client.entity.Result;
import won.transport.taxi.bot.client.entity.Parameter.Area;
import won.transport.taxi.bot.client.entity.Parameter.DepartureAddress;
import won.transport.taxi.bot.client.entity.Parameter.DestinationAddress;
import won.transport.taxi.bot.client.entity.Parameter.OrderId;
import won.transport.taxi.bot.client.entity.Parameter.Parameter;
import won.transport.taxi.bot.client.entity.Parameter.PostCode;
import won.transport.taxi.bot.client.entity.Parameter.Price;
import won.transport.taxi.bot.client.entity.Parameter.ServiceList;
import won.transport.taxi.bot.client.entity.Parameter.State;
import won.transport.taxi.bot.entity.ParseableResult;

@Ignore
public class MobileBookingTest {
private MobileBookingImpl mobileBooking;

Expand Down