The formula for dealing with Japan is not complicated, explains Fathi Abdul Hamid, the Tokyo representative of the Palestine Liberation Organization.

"We say that if there is no peace in the Middle East, oil supplies will naturally be endangered," he says. "And there can be no peace in the Middle East without a Palestinian state."

For an oil-hungry country such as Japan, the message is painfully clear and it has helped to move this country closer and closer to the PLO in the past seven years: Japan wants oil; Arab countries have it, and dealing with them means dealing on closer terms with the PLO.

That relationship may reach an important new stage this year if, as widely expected, PLO leader Yasser Arafat pays a visit to Tokyo. In all but name, it would be an official state visit. He would come as the private guest of Japanese parliament members, but he has been promised audiences with the prime minister and foreign minister.

If Arafat comes -- and one Japanese official says the odds are 50-50 -- it would be an important coup for the PLO as, backed by Arab oil power, it inches toward international recognition. He has never made even unofficial visits to the United States, although he passed through U.S. territory when visiting the United Nations in 1974. Of the Western European countries he has been welcomed only in Austria and Spain.

A trip to Tokyo thus would be regarded as a significant step forward in the noncommunist world.

The substance of the visit may be less important than the simple fact that it occurs. Arafat is expected to press his campaign for recognition of the PLO as the sole representative of Palestinians and for official diplomatic status for his small mission here. The Japanese say they will not agree and will, instead, call on him to renounce terrorism and recognize the right of Israel to exist.

The United States has objected quietly to Arafat's visit, warning that it will not help the cause of peace in the Middle East and may damage Japan's image in the United States.

But Japanese officials, while privately acknowledging the role oil pressures play in their PLO policy, also insist dealing with the organization has independent merit.

"We think that peace and stability in the Middle East are very important and to have them you cannot refuse to have a dialogue with the PLO," said Koichi Tsutsumi, deputy director general of the Foreign Ministry's Middle East and African Bureau. You can't ignore [Arafat]. It is wrong to act as if the PLO is just a group of terrorists. They have influence."

Until the great oil shock of 1973-74, Japan did not have much of a Middle East policy. That region was and is the source of much of its oil. But Japan in those days bought most of its supplies through American oil companies. The oil shock changed all that.

"We suddenly came to realize the Middle Eastern countries are important to us," Tsutsumi recalled.

The policy changed swiftly. In 1974, Japan voted to give the PLO observer status in the United Nations and in 1976 agreed to permit the organization to open a Tokyo office, without diplomatic status.

Japan today goes a step further than West European countries in dealing with the PLO. Like Europe, it agrees to the right of PLO self-determination but, unlike Europe generally, it also asserts that this gives the PLO the right to an independent state.

In the unpretentious PLO office in Tokyo's Shibuya section, Hamid candidly discussed the ways in which Arab and PLO influence has worked to bring Japan around to its present position. He summed it up by saying, "It is a question of mixing economics and politics."

In addition to seeking stable oil supplies from the Middle East, he said, Japan also wants to sell industrial plants and other technologically advanced goods to wealthy Arab states in the process of modernization.

So the PLO's first line of contact is with the businessmen who have great political influence in Japan: "We know the role of industrialists in policy-making in Japan . . . and our channels of influence run through the businessmen and industrialists," he said.

His office supplies those businessmen with information and arranges commercial contacts for them when they visit Middle Eastern countries.

"To any business delegation going to the Middle East, we say that they should meet Palestinians in the normal course of doing business," he added. "They recognize the importance of the Palestinians and we arrange contacts for them."

Hamid's message to businessmen and bureaucrats traveling to the Middle East is that peace and oil supplies are inextricably entangled and that to get along with the Arab countries they must take a favorable attitude toward the PLO.

"We sell them that they can satisfy the Arab counties by taking a realistic view of Palestine," he said.

That message, he said, is also made clear to the Japanese government by leaders of the oil-rich nations. As an example, he cited the visit here in November 1979 of Mana Said Oteiba, oil minister of the United Arab Emirates who had earlier opened negotiations with Japan on the PLO's behalf.

"Oteiba told them that you cannot speak about guarantees of oil and supplies of oil without looking to our political interests, which is the Palestinian question," Hamid said.

That meeting with Oteiba, Hamid asserts, ended with a Japanese promise to arrange audiences for Arafat with the prime minister and foreign minister.

Japan still refuses, however, to issue Arafat a formal invitation for a state visit. The one outstanding now was issued by a group of pro-Arab parliament members headed by a former foreign minister, Toshio Kimura.

At first, Arafat seemed inclined to reject the invitation since it did not offer the formal recognition of a state visit. But he has recently accepted the principle of coming as an unofficial visitor with the promise of seeing Prime Minister Zenko Suzuki and Foreign Minister Masayoshi Ito.

Japanese officials said they made it clear they would not promise Arafat they would recognize his organization as the sole representative of the Palestinians and that they would not grant diplomatic status to the office Hamid heads in Tokyo.