wn_pl - description of Prolog database files


The files wn_ .pl contain the WordNet database in a prolog-readable format. A prolog interface to WordNet is not implemented.

The prolog database is very large and may take many minutes to load into the Prolog workspace. A separate file has been created for each WordNet relation giving the user the ability to load only those parts of the database that they are interested.

See FILES , below, for a list of the database files and wndb(5WN) and wninput(5WN) for detailed descriptions of the various WordNet relations (referred to as operators in this manual page).

File Format

Each prolog database file contains information corresponding to the synsets and word senses contained in the WordNet database. In the prolog version of the database, the synset_id s (defined below) are used as unique synset identifiers.

Each line of a file contains an operator that corresponds to a WordNet relation. All lines with the same operator value are stored in the file wn_ operator .pl .

The general format of a line in a prolog database file is as follows:


operator(field1,  ...  ,fieldn). 

Each line contains the name of the operator, followed by a left parenthesis, a comma-separated list of fields, a right parenthesis, and a period. Note there are no spaces, and each line is terminated with a newline character.


Each WordNet relation is represented in a separate file by operator name. Some operators are reflexive (i.e. the "reverse" relation is implicit). So, for example, if is a hypernym of is necessarily a hyponym of . In the prolog database, reflected pointers are usually implied for semantic relations.

Semantic relations are represented by a pair of synset_id s, in which the first synset_id is generally the source of the relation and the second is the target. If two pairs synset_id w_num are present, the operator represents a lexical relation between word forms.


operator is present for every word sense in WordNet. In w_num specifies the word number for word in the synset.


sk operator is present for every word sense in WordNet. This gives the WordNet sense key for each word sense.


The operator specifies the gloss for a synset.


The syntax operator specifies the syntactic marker for a given word sense if one is specified.


The hyp operator specifies that the second synset is a hypernym of the first synset. This relation holds for nouns and verbs. The reflexive operator, hyponym, implies that the first synset is a hyponym of the second synset.


The ins operator specifies that the first synset is an instance of the second synset. This relation holds for nouns. The reflexive operator, has_instance, implies that the second synset is an instance of the first synset.


The ent operator specifies that the second synset is an entailment of first synset. This relation only holds for verbs.


The sim operator specifies that the second synset is similar in meaning to the first synset. This means that the second synset is a satellite the first synset, which is the cluster head. This relation only holds for adjective synsets contained in adjective clusters.


The mm operator specifies that the second synset is a member meronym of the first synset. This relation only holds for nouns. The reflexive operator, member holonym, can be implied.


The ms operator specifies that the second synset is a substance meronym of the first synset. This relation only holds for nouns. The reflexive operator, substance holonym, can be implied.


The mp operator specifies that the second synset is a part meronym of the first synset. This relation only holds for nouns. The reflexive operator, part holonym, can be implied.


The der operator specifies that there exists a reflexive lexical morphosemantic relation between the first and second synset terms representing derivational morphology.


The cls operator specifies that the first synset has been classified as a member of the class represented by the second synset. Either of the w_num's can be 0, reflecting that the pointer is semantic in the original WordNet database.


The cs operator specifies that the second synset is a cause of the first synset. This relation only holds for verbs.


The vgp operator specifies verb synsets that are similar in meaning and should be grouped together when displayed in response to a grouped synset search.


The at operator defines the attribute relation between noun and adjective synset pairs in which the adjective is a value of the noun. For each pair, both relations are listed (ie. each synset_idis both a source and target).


The ant operator specifies antonymous word s. This is a lexical relation that holds for all syntactic categories. For each antonymous pair, both relations are listed (ie. each synset_id,w_numpair is both a source and target word.)


The sa operator specifies that additional information about the first word can be obtained by seeing the second word. This operator is only defined for verbs and adjectives. There is no reflexive relation (ie. it cannot be inferred that the additional information about the second word can be obtained from the first word).


The ppl operator specifies that the adjective first word is a participle of the verb second word. The reflexive operator can be implied.


The per operator specifies two different relations based on the parts of speech involved. If the first word is in an adjective synset, that word pertains to either the noun or adjective second word. If the first word is in an adverb synset, that word is derived from the adjective second word.


The fr operator specifies a generic sentence frame for one or all words in a synset. The operator is defined only for verbs.


Field Definitions

synset_id is a nine byte field in which the first byte defines the syntactic category of the synset and the remaining eight bytes are a synset_offset , as defined in wndb(5WN) , indicating the byte offset in the data. pos file that corresponds to the syntactic category.

The syntactic category is encoded as:



w_num , if present, indicates which word in the synset is being referred to. Word numbers are assigned to the word fields in a synset, from left to right, beginning with 1. When used to represent lexical WordNet relations w_num may be 0, indicating that the relation holds for all words in the synset indicated by the preceding synset_id . See wninput(5WN) for a discussion of semantic and lexical relations.

ss_type is a one character code indicating the synset type:



sense_number specifies the sense number of the word, within the part of speech encoded in the synset_id , in the WordNet database.

word is the ASCII text of the word as entered in the synset by the lexicographer. The text of the word is case sensitive. An adjective word is immediately followed by a syntactic marker if one was specified in the lexicographer file.

sense_key specifies the WordNet sense key for a given word sense. See senseidx(5WN) for the specifications.

syntax is the syntactic marker for a given adjective sense if one was specified in the input files. See wninput(5WN) for a list of the syntactic markers. Note that in the Prolog database, the parentheses are not included.

Each synset has a gloss that contains a definition and one or more example sentences.

class_type indicates whether the classification relation represented is topical, usage, or regional, as indicated by the class_type of , or , respectively.

f_num specifies the generic sentence frame number for word w_num in the synset indicated by synset_id . Note that when w_num is , the frame number applies to all words in the synset. If non-zero, the frame applies to that word in the synset.

In WordNet, sense numbers are assigned as described in wndb(5WN) . tag_count is the number of times the sense was tagged in the Semantic Concordances, and if it was not instantiated.


Since single forward quotes are used to enclose character strings, single quote characters found in word and gloss fields are represented as two adjacent single quote characters.

The load time can be greatly reduced by creating "object language" versions of the files, an option that is supported by some implementations, such as Quintus Prolog.

Environment Variables (Unix)

Base directory for WordNet. Default is /usr/local/WordNet-2.1 .

Registry (Windows)

Base directory for WordNet. Default is C:\Program Files\WordNet\2.1 .


All files are in WNHOME/prolog on Unix platforms and WNHome\prolog on Windows platforms
synset pointers
sense keys
syntactic markers
gloss pointers
hypernym pointers
instance pointers
entailment pointers
similar pointers
member meronym pointers
substance meronym pointers
part meronym pointers
derivational morphology pointers
class (domain) pointers
cause pointers
grouped verb pointers
attribute pointers
antonym pointers
see also pointers
participle pointers
pertainym pointers
frame pointers

See Also

wndb(5WN) , wninput(5WN) , senseidx(5WN) , wngroups(7WN) , wnpkgs(7WN) .