Find

Article
· Apr 27, 2024 3m read

Recherche vectorielle géographique #2

Surprises techniques à l'aide de VECTORs

La construction de mon exemple technologique m'a permis de faire un certain nombre de découvertes que je souhaite partager.
Les premiers vecteurs que j'ai touchés sont apparus avec l'analyse de texte et plus de 200 dimensions.
Je dois avouer que je me sens bien dans le monde à 4 dimensions d'Einstein.
Les 7 à 15 dimensions qui peuplent la théorie des cordes dépassent quelque peu la frontière.
Mais 200 et plus, c'est définitivement bien au-delà de mon horizon mathématique.

Ndt : Je partage avec Robert la difficulté d'abstraction pour un grand nombre de dimensions, ce qui pour moi, rend l'exemple suivant très pertinent

Je me suis donc tourné vers notre planète et j'ai trouvé qu'un vecteur de (latitude, longitude) à 2 dimensions était suffisant pour les tests.
Un tableau pratique des capitales a été trouvé et a fourni un échantillon de données de test (abrégé).

CAPITAL COUNTRY LATITUDE LONGITUDE
Kabul Afghanistan 34.28N 69.11E
Tirana Albania 41.18N 19.49E
Algiers Algeria 36.42N 03.08E
Pago Pago American Samoa 14.16S 170.43W
Andorra la Vella Andorra 42.31N 01.32E
Luanda Angola 08.50S 13.15E
Saint John's Antigua and Barbuda 17.127N 61.846W
Buenos Aires Argentina 36.30S 60.00W
Yerevan Armenia 40.10N 44.31E
Oranjestad Aruba 12.32N 70.02W
Canberra Australia 35.15S 149.08E
Vienna Austria 48.12N 16.22E
Baku Azerbaijan 40.29N 49.56E
Nassau Bahamas 25.05N 77.20W
Manama Bahrain 26.10N 50.30E
Dhaka Bangladesh 23.43N 90.26E
Bridgetown Barbados 13.05N 59.30W
Minsk Belarus 53.52N 27.30E
Brussels Belgium 50.51N 04.21E

#1 Le chargement de ce fichier texte séparé par des tabulations avec LOAD DATA (SQL) a parfaitement fonctionné

#2 La transformation des coordonnées géographiques en INT était un exercice de codage mineur
Il en résulte une ClassMethod projetée en tant que procédure SQL utilisée dans une UPDATE sur la table.

#3 Comme les coordonnées géographiques se réfèrent à (0°N,0°W) quelque part dans l'Atlantique, ce n'est qu'une base théorique pour mes vecteurs.
IRIS supporte quelques fonctions VECTOR mais je n'ai trouvé aucune fonction AddVector() ou SubtractVector().
J'ai donc procédé « manuellement » à partir des coordonnées d'entrée.
Il est nécessaire de transformer les coordonnées en un point de base utile pour comparer ultérieurement les vecteurs
Il existe donc des coordonnées de BASE statiques et des coordonnées d'OEUVRE actives.

Obtenir les valeurs du vecteur est facile avec SQL en utilisant la fonction %EXTERNAL()
tandis qu'en ObjectScript, j'ai obtenu

        set vectorvalues=##class(%Vector).LogicalToOdbc(vectorvaraible) 

c'était moins impressionnant pour travailler avec des vecteurs.

#4
La similitude est calculée avec la fonction VECTOR_COSINE().
Vous calculez l'angle entre 2 vecteurs et COSINE le normalise entre +1 et -1.
L'entrée nécessite 2 vecteurs de même type et de même dimension.
Les exemples présentés dans la documentation fonctionnent bien si vous composez votre chaîne SQL comme suggéré
et TO_VETOR( ?,type,size) est OK avec %SQLStatement pour l'exécution.
MAIS :

J'ai essayé avec du code SQL intégré.
La vérification du code a signalé un certain désaccord, mais la compilation s'est déroulée sans problème
Lors de l'exécution, il s'est avéré que les variables hôtes dans TO_VECTOR(:myvec,INT,2) échouaient.
quelle que soit la combinaison de guillemets, accolades, .... que j'ai essayée.
Soyez donc avertis. Je suis retourné à %SQLStatement pour terminer mon VCOS.

#5 J'ai été surpris d'apprendre à quel point VECTOR_COSINE se propageait.
La vérification du vecteur Paris >> Bucuresti a permis de retracer la moitié du Moyen-Orient et de l'Asie de l'Est.
Limiter les résultats à > 0,999 est donc une bonne pratique dans ce scénario.

3 Comments
Discussion (3)1
Log in or sign up to continue
Announcement
· Apr 22, 2024

The Global Masters Program will be temporarily PAUSED from April 26th

Access for Global Masters:

Please access Global Masters via
 this link.

Log in using InterSystems SSO ("Login with InterSystems" button on the left). 


At InterSystems, we strive to give you the best quality in everything. Including the realization of our Global Masters program. 

The vendor of this platform has been acquired by another company, and unfortunately, we will no longer be able to continue hosting our esteemed Global Masters program on this platform. We are currently evaluating new platform providers to facilitate the transition of the Global Masters Advocate Hub.

Beginning April 26th, we will temporarily suspend access to the Global Masters program as we transition to a new platform.

FAQ:

YOUR POINTS, BADGES AND LEVEL

All points, badges and achievements will be saved as of April 26th. We will transfer all data to a new platform.

YOUR CONTRIBUTIONS TO DEVELOPER ECOSYSTEM 

During the migration, we will still be counting all contributions to Developer Ecosystems (posts, comments, applications, etc) automatically. These well-deserved points and badges will be added to your profile upon the launch of a new program.

PRIZES

To provide an opportunity to redeem prizes during the migration, we plan to build a special webpage with prizes as soon as possible. However, we encourage you to redeem prizes you had planned to redeem before April 26th (on April 26th prizes will be already unpublished), as this functionality will not be available for some time.

WHAT'S NEXT

All information regarding the upgrade will be published in the Discord and Developer Community channels. We apologize for any inconvenience and will endeavor to complete the migration as soon as possible. 

WHERE TO ASK QUESTION? GLOBAL MASTERS SUPPORT 

Reach out to Olga @Olga Zavrazhnova in DM here or ask questions in a dedicated Global Masters channel on Discord. Let's stay in touch!

WE WILL UPDATE YOU ON THE ESTIMATE DATE OF LAUNCH SOON

We are looking forward to meeting you soon on a new platform!
Sincerely yours, 
Global Masters and Developer Community team

4 Comments
Discussion (4)4
Log in or sign up to continue
Question
· Apr 18, 2024

initial user account

I installed a local docker container instance from here:   intersystemsdc/iris-community

I'm trying to login:    http://localhost:52773/csp/sys/UtilHome.csp

I thought if I used SYSTEM as the initial username, I could login, but I get #822 Access Denied.

Is that the correct username? maybe there's a better location to pull the docker instance.

***************nevermind, figured it out

3 Comments
Discussion (3)3
Log in or sign up to continue
Question
· Apr 11, 2024

Question about InterSystems API (IAM) install from tar file with IRIS running locally

I downloaded IAM-3.4.2.0-5604.tar.gz from the Online Distribution site this morning, it the implementation to install it on our Development environment to see if it is a viable solution. Following the instructions, I have ran into an issue trying to make sure I am entering the information into the prompts correctly.

I have IRIS HealthShare Health Connect 2024.1 running locally using a Local Web Server, so when prompted I have entered the IP Address and port 443 is that correct? 

:>iam-setup.sh
Welcome to the InterSystems IRIS and InterSystems API Manager (IAM) setup script.
This script sets the ISC_IRIS_URL environment variable that is used by the IAM container to get the IAM license key from InterSystems IRIS.
Enter the full image repository, name and tag for your IAM docker image:
intersystems/iam:3.4.1.0
Enter the IP address for your InterSystems IRIS instance. The IP address has to be accessible from within the IAM container, therefore, do not use "localhost" or "127.0.0.1" if IRIS is running on your local machine. Instead use the IP address of your local machine. If IRIS is running in a container, use the IP address of the host environment, not the IP address of the IRIS container:
xxx.xxx.xxx.xxx
Enter the web server port for your InterSystems IRIS instance:
443
Enter the password for the IAM user for your InterSystems IRIS instance:
Re-enter your password:
If local policy requires that HTTPS be used for communication, please provide the full path to your CA Certificate file now. Otherwise hit "Return":
/etc/pki/ca-trust/source/anchors/OSUWMC_CA.pem
If your InterSystems IRIS instance is only accessible via its CSPConfigName URL prefix, please provide the prefix with a trailing slash (/) now. Otherwise hit "Return":

Your inputs are:
Full image repository, name and tag for your IAM docker image: intersystems/iam:3.4.1.0
IP address for your InterSystems IRIS instance: xxx.xxx.xxx.xxx
Web server port for your InterSystems IRIS instance: 443
CA Certificate for HTTPS: /etc/pki/ca-trust/source/anchors/OSUWMC_CA.pem
CSPConfigName URL prefix:
Would you like to continue with these inputs (y/n)?
y
Getting IAM license using your inputs...

Couldn't reach InterSystems IRIS at xxx.xxx.xxx.xxx:443. One or both of your IP and Port are incorrect.

I have verified that...

  • IAM user is enabled
  • /api/iam is enabled

What port should be specified if you are running a Local Web Server/Web Gateway?

Thanks

Scott

9 Comments
Discussion (9)2
Log in or sign up to continue
Question
· Apr 10, 2024

Initiating a Method After a Timeout During Message Delivery

Hello everyone,

I'm currently working on a business operation that employs a retry mechanism with a FailureTimeout = -1. So, this BO attempts to resend the message at the end of a RetryInterval of n seconds (n is configurable).

What I would like to achieve is to set a timer that runs in parallel with the sending mechanism so that, If I don't receive a response within m seconds (also is configurable and m<=n) from the initial message send (with RetryCount = 1), an alert or something similar is triggered. The latter should initiate a second method to run concurrently with the first one (which is still attempting to send), allowing me to send a message to a business process to handle the situation. Then this BP will process the alert appropriately, such as sending an email or notification.

I've tried some solutions using the JOB command and the BO's Alerting settings (for ex., Queue Wait Alert), but I haven't been able to achieve the desired result. I'm not familiar with process parallelization in IRIS, so I was wondering if someone more experienced could point me in the right direction for this implementation.

Thank you

4 Comments
Discussion (4)3
Log in or sign up to continue