-
Notifications
You must be signed in to change notification settings - Fork 0
/
cardOntology.java
56 lines (39 loc) · 1.66 KB
/
cardOntology.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package book;
import jade.content.onto.*;
import jade.content.schema.*;
public class cardOntology extends Ontology{
public static final String ONTOLOGY_NAME = "cardOntology";
public static final String CARD = "CARD";
public static final String CARD_TYPE = "type";
public static final String CARD_NUMBER = "number";
public static final String OFFER = "Offer";
public static final String OFFER_CARD = "card";
public static final String DEAL = "Deal";
public static final String DEAL_CARD = "card";
private static Ontology instance = new cardOntology();
public static Ontology getInstance() {
return instance;
}
private cardOntology()
{
super(ONTOLOGY_NAME, BasicOntology.getInstance());
try
{
add(new ConceptSchema(CARD),Card.class);
add(new PredicateSchema(OFFER), Offer.class);
add(new AgentActionSchema(DEAL) , Deal.class);
//Concept schema structure
ConceptSchema cs = (ConceptSchema) getSchema(CARD);
cs.add(CARD_TYPE, (PrimitiveSchema) getSchema(BasicOntology.STRING));
cs.add(CARD_NUMBER, (PrimitiveSchema) getSchema(BasicOntology.STRING));
//Structure for OFFER predicate
PredicateSchema ps = (PredicateSchema) getSchema(OFFER);
ps.add(OFFER_CARD, (ConceptSchema) getSchema(CARD));
AgentActionSchema as = (AgentActionSchema) getSchema(DEAL);
as.add(DEAL_CARD, (ConceptSchema) getSchema(CARD));
}catch (OntologyException e)
{
e.printStackTrace();
}
}
}