Embedded Python VS ObjectScript - Test de performance à l'aide des fichiers XML
Depuis l'introduction d'Embedded Python, il y a toujours eu un doute sur ses performances par rapport à ObjectScript et J'en ai discuté à plusieurs reprises avec @Guillaume Rongier , eh bien, profitant du fait que je faisais une petite application pour capturer les données des concours publics en Espagne et pouvoir effectuer des recherches en utilisant les capacités de VectorSearch, j'ai vu l'opportunité de réaliser un petit test.
Données pour le test
Les informations relatives aux concours publics sont fournies mensuellement dans des fichiers XML à partir de cette URL et le format typique des informations d'un concours est le suivant:
<id>https://contrataciondelestado.es/sindicacion/licitacionesPerfilContratante/15070121</id>
<link href="https://contrataciondelestado.es/wps/poc?uri=deeplink:detalle_licitacion&idEvl=zVQ4gDdr3Y436J9Lctlsuw%3D%3D"/>
<summary type="text">Id licitación: C54243062800; Órgano de Contratación: Dirección General de Carreteras; Importe: 3088367.31 EUR; Estado: RES</summary>
<title>39-MU-6280; 54.408/24. Actuaciones para el desarrollo del plan de acción contra el ruido de la Fase II en la Región de Murcia. Plan de Recuperación, Transformación y Resiliencia, Next Generation EU.</title>
<updated>2024-12-19T07:58:39.502+01:00</updated>
<cac-place-ext:ContractFolderStatus>
<cbc:ContractFolderID>C54243062800</cbc:ContractFolderID>
<cbc-place-ext:ContractFolderStatusCode listURI="https://contrataciondelestado.es/codice/cl/2.04/SyndicationContractFolderStatusCode-2.04.gc" languageID="es">RES</cbc-place-ext:ContractFolderStatusCode>
<cac-place-ext:LocatedContractingParty>
<cbc:ContractingPartyTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.10/ContractingAuthorityCode-2.10.gc">1</cbc:ContractingPartyTypeCode>
<cbc:ActivityCode listURI="http://contrataciondelestado.es/codice/cl/2.10/ContractingAuthorityActivityCode-2.10.gc">1</cbc:ActivityCode>
<cbc:BuyerProfileURIID>https://contrataciondelestado.es/wps/poc?uri=deeplink:perfilContratante&idBp=bbqeQ9uN6YE%3D</cbc:BuyerProfileURIID>
<cac:Party>
<cbc:WebsiteURI>http://www.fomento.es</cbc:WebsiteURI>
<cac:PartyIdentification>
<cbc:ID schemeName="DIR3">E00124905</cbc:ID>
</cac:PartyIdentification>
<cac:PartyIdentification>
<cbc:ID schemeName="NIF">S2817015G</cbc:ID>
</cac:PartyIdentification>
<cac:PartyIdentification>
<cbc:ID schemeName="ID_PLATAFORMA">10000170000108</cbc:ID>
</cac:PartyIdentification>
<cac:PartyName>
<cbc:Name>Dirección General de Carreteras</cbc:Name>
</cac:PartyName>
<cac:PostalAddress>
<cbc:CityName>Madrid</cbc:CityName>
<cbc:PostalZone>28071</cbc:PostalZone>
<cac:AddressLine>
<cbc:Line>Paseo de la Castellana 67 - Despacho B750</cbc:Line>
</cac:AddressLine>
<cac:Country>
<cbc:IdentificationCode listURI="http://contrataciondelestado.es/codice/cl/2.08/CountryIdentificationCode-2.08.gc">ES</cbc:IdentificationCode>
<cbc:Name>España</cbc:Name>
</cac:Country>
</cac:PostalAddress>
<cac:Contact>
<cbc:Name>Dirección General de Carreteras</cbc:Name>
<cbc:Telephone>915978341</cbc:Telephone>
<cbc:Telefax>915978547</cbc:Telefax>
<cbc:ElectronicMail>dgc.licitaciones@fomento.es</cbc:ElectronicMail>
</cac:Contact>
</cac:Party>
<cac-place-ext:ParentLocatedParty>
<cac:PartyName>
<cbc:Name>Dirección General de Carreteras</cbc:Name>
</cac:PartyName>
<cac-place-ext:ParentLocatedParty>
<cac:PartyName>
<cbc:Name>Secretaría General de Transporte Terrestre</cbc:Name>
</cac:PartyName>
<cac-place-ext:ParentLocatedParty>
<cac:PartyName>
<cbc:Name>Secretaría de Estado de Transportes y Movilidad Sostenible</cbc:Name>
</cac:PartyName>
<cac-place-ext:ParentLocatedParty>
<cac:PartyIdentification>
<cbc:ID schemeName="DIR3">E05229701</cbc:ID>
</cac:PartyIdentification>
<cac:PartyName>
<cbc:Name>Ministerio de Transportes y Movilidad Sostenible</cbc:Name>
</cac:PartyName>
<cac-place-ext:ParentLocatedParty>
<cac:PartyIdentification>
<cbc:ID schemeName="DIR3">EA9999999</cbc:ID>
</cac:PartyIdentification>
<cac:PartyName>
<cbc:Name>ADMINISTRACIÓN GENERAL DEL ESTADO</cbc:Name>
</cac:PartyName>
<cac-place-ext:ParentLocatedParty>
<cac:PartyName>
<cbc:Name>Sector Público</cbc:Name>
</cac:PartyName>
</cac-place-ext:ParentLocatedParty>
</cac-place-ext:ParentLocatedParty>
</cac-place-ext:ParentLocatedParty>
</cac-place-ext:ParentLocatedParty>
</cac-place-ext:ParentLocatedParty>
</cac-place-ext:ParentLocatedParty>
</cac-place-ext:LocatedContractingParty>
<cac:ProcurementProject>
<cbc:Name>39-MU-6280; 54.408/24. Actuaciones para el desarrollo del plan de acción contra el ruido de la Fase II en la Región de Murcia. Plan de Recuperación, Transformación y Resiliencia, Next Generation EU.</cbc:Name>
<cbc:TypeCode listURI="http://contrataciondelestado.es/codice/cl/2.08/ContractCode-2.08.gc">3</cbc:TypeCode>
<cbc:SubTypeCode listURI="http://contrataciondelestado.es/codice/cl/1.04/WorksContractCode-1.04.gc">4500</cbc:SubTypeCode>
<cbc:MixContractIndicator>false</cbc:MixContractIndicator>
<cac:BudgetAmount>
<cbc:EstimatedOverallContractAmount currencyID="EUR">3706040.77</cbc:EstimatedOverallContractAmount>
<cbc:TotalAmount currencyID="EUR">3736924.45</cbc:TotalAmount>
<cbc:TaxExclusiveAmount currencyID="EUR">3088367.31</cbc:TaxExclusiveAmount>
</cac:BudgetAmount>
<cac:RequiredCommodityClassification>
<cbc:ItemClassificationCode listURI="http://contrataciondelestado.es/codice/cl/2.04/CPV2008-2.04.gc">45233000</cbc:ItemClassificationCode>
</cac:RequiredCommodityClassification>
<cac:RealizedLocation>
<cbc:CountrySubentity>Región de Murcia</cbc:CountrySubentity>
<cbc:CountrySubentityCode listURI="http://contrataciondelestado.es/codice/cl/2.08/NUTS-2021.gc">ES62</cbc:CountrySubentityCode>
<cac:Address>
<cac:Country>
<cbc:IdentificationCode listURI="http://contrataciondelestado.es/codice/cl/2.08/CountryIdentificationCode-2.08.gc">ES</cbc:IdentificationCode>
<cbc:Name>España</cbc:Name>
</cac:Country>
</cac:Address>
</cac:RealizedLocation>
<cac:PlannedPeriod>
<cbc:DurationMeasure unitCode="MON">6</cbc:DurationMeasure>
</cac:PlannedPeriod>
</cac:ProcurementProject>
<cac:TenderResult>
<cbc:ResultCode listURI="http://contrataciondelestado.es/codice/cl/2.09/TenderResultCode-2.09.gc">9</cbc:ResultCode>
<cbc:Description>Por ser la ofertas más ventajosa</cbc:Description>
<cbc:AwardDate>2024-11-26</cbc:AwardDate>
<cbc:ReceivedTenderQuantity>20</cbc:ReceivedTenderQuantity>
<cbc:LowerTenderAmount currencyID="EUR">2388215.74</cbc:LowerTenderAmount>
<cbc:HigherTenderAmount currencyID="EUR">2764090</cbc:HigherTenderAmount>
<cbc:SMEsReceivedTenderQuantity>6</cbc:SMEsReceivedTenderQuantity>
<cbc:SMEAwardedIndicator>false</cbc:SMEAwardedIndicator>
<cac:Contract>
<cbc:IssueDate>2024-12-18</cbc:IssueDate>
</cac:Contract>
<cac:WinningParty>
<cac:PartyIdentification>
<cbc:ID schemeName="NIF">A17013863</cbc:ID>
</cac:PartyIdentification>
<cac:PartyName>
<cbc:Name>CONSTRUCCIONES RUBAU, S.A.</cbc:Name>
</cac:PartyName>
<cac:PhysicalLocation>
<cac:Address>
<cbc:CityName>Madrid</cbc:CityName>
<cbc:PostalZone>28046</cbc:PostalZone>
<cac:Country>
<cbc:IdentificationCode listURI="http://contrataciondelestado.es/codice/cl/2.08/CountryIdentificationCode-2.08.gc" name="España">ES</cbc:IdentificationCode>
</cac:Country>
</cac:Address>
</cac:PhysicalLocation>
</cac:WinningParty>
<cac:AwardedTenderedProject>
<cac:LegalMonetaryTotal>
<cbc:TaxExclusiveAmount currencyID="EUR">2469149.66</cbc:TaxExclusiveAmount>
<cbc:PayableAmount currencyID="EUR">2987671.09</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
</cac:AwardedTenderedProject>
</cac:TenderResult>
<cac:TenderingTerms>
<cbc:RequiredCurriculaIndicator>false</cbc:RequiredCurriculaIndicator>
<cbc:VariantConstraintIndicator>false</cbc:VariantConstraintIndicator>
<cbc:FundingProgramCode listURI="http://contrataciondelestado.es/codice/cl/2.08/FundingProgramCode-2.08.gc" name="Financiación con fondos de la UE">EU</cbc:FundingProgramCode>
<cbc:FundingProgramCode listURI="http://contrataciondelestado.es/codice/cl/2.08/FundingProgramCode-2.08.gc" name="Asociado al Plan de Recuperación, Transformación y Resiliencia">PRTR</cbc:FundingProgramCode>
<cbc:FundingProgram>NEXT GENERATION EU</cbc:FundingProgram>
<cbc:ProcurementNationalLegislationCode listURI="https://contrataciondelestado.es/codice/cl/2.08/ProcurementNationalLegislationCode-2.08.gc">3</cbc:ProcurementNationalLegislationCode>
<cbc:ReceivedAppealQuantity>0</cbc:ReceivedAppealQuantity>
<cac:RequiredFinancialGuarantee>
<cbc:GuaranteeTypeCode listURI="http://contrataciondelestado.es/codice/cl/1.04/GuaranteeTypeCode-1.04.gc">3</cbc:GuaranteeTypeCode>
<cbc:AmountRate>5</cbc:AmountRate>
</cac:RequiredFinancialGuarantee>
<cac:RequiredFinancialGuarantee>
<cbc:GuaranteeTypeCode listURI="http://contrataciondelestado.es/codice/cl/1.04/GuaranteeTypeCode-1.04.gc">2</cbc:GuaranteeTypeCode>
<cbc:AmountRate>5</cbc:AmountRate>
</cac:RequiredFinancialGuarantee>
<cac:ProcurementLegislationDocumentReference>
<cbc:ID>N/A</cbc:ID>
</cac:ProcurementLegislationDocumentReference>
<cac:TendererQualificationRequest>
<cac:RequiredBusinessClassificationScheme>
<cbc:ID>RequiredBusinessProfileCode</cbc:ID>
<cac:ClassificationCategory>
<cbc:CodeValue>G6-5</cbc:CodeValue>
</cac:ClassificationCategory>
</cac:RequiredBusinessClassificationScheme>
<cac:FinancialEvaluationCriteria>
<cbc:EvaluationCriteriaTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.0/FinancialCapabilityTypeCode-2.0.gc">ZZZ</cbc:EvaluationCriteriaTypeCode>
<cbc:Description>Se acreditará con la clasificación</cbc:Description>
</cac:FinancialEvaluationCriteria>
<cac:SpecificTendererRequirement>
<cbc:RequirementTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.08/DeclarationTypeCode-2.08.gc">1</cbc:RequirementTypeCode>
<cbc:Description>Capacidad de obrar</cbc:Description>
</cac:SpecificTendererRequirement>
</cac:TendererQualificationRequest>
<cac:AwardingTerms>
<cac:AwardingCriteria>
<cbc:AwardingCriteriaTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.0/AwardingCriteriaCode-2.0.gc">SUBJ</cbc:AwardingCriteriaTypeCode>
<cbc:Description>Juicio de valor</cbc:Description>
<cbc:Note>Criterios evaluables mediante juicio de valor.</cbc:Note>
<cbc:AwardingCriteriaSubTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.09/AwardingCriteriaNotAutomaticallyEvaluatedSubTypeCode-2.09.gc">99</cbc:AwardingCriteriaSubTypeCode>
<cbc:WeightNumeric>49</cbc:WeightNumeric>
</cac:AwardingCriteria>
<cac:AwardingCriteria>
<cbc:AwardingCriteriaTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.0/AwardingCriteriaCode-2.0.gc">OBJ</cbc:AwardingCriteriaTypeCode>
<cbc:Description>Precio</cbc:Description>
<cbc:AwardingCriteriaSubTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.09/AwardingCriteriaAutomaticallyEvaluatedSubTypeCode-2.09.gc">1</cbc:AwardingCriteriaSubTypeCode>
<cbc:WeightNumeric>45.9</cbc:WeightNumeric>
</cac:AwardingCriteria>
<cac:AwardingCriteria>
<cbc:AwardingCriteriaTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.0/AwardingCriteriaCode-2.0.gc">OBJ</cbc:AwardingCriteriaTypeCode>
<cbc:Description>Incremento de gastos de ensayos</cbc:Description>
<cbc:Note>El licitador deberá consignar el porcentaje total de gastos de ensayo al que se compromete</cbc:Note>
<cbc:AwardingCriteriaSubTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.09/AwardingCriteriaAutomaticallyEvaluatedSubTypeCode-2.09.gc">2</cbc:AwardingCriteriaSubTypeCode>
<cbc:WeightNumeric>5.1</cbc:WeightNumeric>
</cac:AwardingCriteria>
</cac:AwardingTerms>
<cac:TenderRecipientParty>
<cbc:EndpointID>https://contrataciondelestado.es</cbc:EndpointID>
</cac:TenderRecipientParty>
<cac:Language>
<cbc:ID>es</cbc:ID>
</cac:Language>
</cac:TenderingTerms>
<cac:TenderingProcess>
<cbc:ProcedureCode listURI="https://contrataciondelestado.es/codice/cl/2.07/SyndicationTenderingProcessCode-2.07.gc">1</cbc:ProcedureCode>
<cbc:UrgencyCode listURI="http://contrataciondelestado.es/codice/cl/1.04/DiligenceTypeCode-1.04.gc">1</cbc:UrgencyCode>
<cbc:ContractingSystemCode listURI="http://contrataciondelestado.es/codice/cl/2.08/ContractingSystemTypeCode-2.08.gc">0</cbc:ContractingSystemCode>
<cbc:SubmissionMethodCode listURI="http://contrataciondelestado.es/codice/cl/1.04/TenderDeliveryCode-1.04.gc">1</cbc:SubmissionMethodCode>
<cbc:OverThresholdIndicator>false</cbc:OverThresholdIndicator>
<cac:DocumentAvailabilityPeriod>
<cbc:EndDate>2024-07-11</cbc:EndDate>
<cbc:EndTime>19:00:00</cbc:EndTime>
</cac:DocumentAvailabilityPeriod>
<cac:TenderSubmissionDeadlinePeriod>
<cbc:EndDate>2024-07-11</cbc:EndDate>
<cbc:EndTime>19:00:00</cbc:EndTime>
</cac:TenderSubmissionDeadlinePeriod>
<cac:AuctionTerms>
<cbc:AuctionConstraintIndicator>false</cbc:AuctionConstraintIndicator>
</cac:AuctionTerms>
</cac:TenderingProcess>
<cac:LegalDocumentReference>
<cbc:ID>10 39-MU-6280_PCAP1 COMPLETO.pdf</cbc:ID>
<cac:Attachment>
<cac:ExternalReference>
<cbc:URI>https://contrataciondelestado.es/wps/wcm/connect/PLACE_es/Site/area/docAccCmpnt?srv=cmpnt&cmpntname=GetDocumentsById&source=library&DocumentIdParam=e5192f55-437c-4336-bcae-fa5ed89ed137</cbc:URI>
<cbc:DocumentHash>TaNyzb5w+ClWd4GazjY4A6j0n90=</cbc:DocumentHash>
</cac:ExternalReference>
</cac:Attachment>
</cac:LegalDocumentReference>
<cac:TechnicalDocumentReference>
<cbc:ID>13 39-MU-6280 ENLACES PROYECTO.pdf</cbc:ID>
<cac:Attachment>
<cac:ExternalReference>
<cbc:URI>https://contrataciondelestado.es/wps/wcm/connect/PLACE_es/Site/area/docAccCmpnt?srv=cmpnt&cmpntname=GetDocumentsById&source=library&DocumentIdParam=5f34283e-8f1f-4111-83bc-6ee7c627f85a</cbc:URI>
<cbc:DocumentHash>C+IvGwHro7JPdvGq0G0Zw5qd4jQ=</cbc:DocumentHash>
</cac:ExternalReference>
</cac:Attachment>
</cac:TechnicalDocumentReference>
<cac:AdditionalDocumentReference>
<cbc:ID>39-MU-6280.xml</cbc:ID>
<cac:Attachment>
<cac:ExternalReference>
<cbc:URI>https://contrataciondelestado.es/wps/wcm/connect/PLACE_es/Site/area/docAccCmpnt?srv=cmpnt&cmpntname=GetDocumentsById&source=library&DocumentIdParam=f0de9e5c-3148-464a-9d1d-6755d7ce3e97</cbc:URI>
<cbc:DocumentHash>Mo8VWVuBQYTANqJQ8I2ydW6lmkM=</cbc:DocumentHash>
</cac:ExternalReference>
</cac:Attachment>
</cac:AdditionalDocumentReference>
<cac:AdditionalDocumentReference>
<cbc:ID>Instrucciones DEUC.pdf</cbc:ID>
<cac:Attachment>
<cac:ExternalReference>
<cbc:URI>https://contrataciondelestado.es/wps/wcm/connect/PLACE_es/Site/area/docAccCmpnt?srv=cmpnt&cmpntname=GetDocumentsById&source=library&DocumentIdParam=f8ffa4b2-7c67-41f4-ad8c-490a1cd924e4</cbc:URI>
<cbc:DocumentHash>2XK7llhvbjvUXAN8KlDbZhtleg8=</cbc:DocumentHash>
</cac:ExternalReference>
</cac:Attachment>
</cac:AdditionalDocumentReference>
<cac:AdditionalDocumentReference>
<cbc:ID>39-MU-6280.pdf</cbc:ID>
<cac:Attachment>
<cac:ExternalReference>
<cbc:URI>https://contrataciondelestado.es/wps/wcm/connect/PLACE_es/Site/area/docAccCmpnt?srv=cmpnt&cmpntname=GetDocumentsById&source=library&DocumentIdParam=d52c9815-e054-4aea-aed0-b0a43a9c77d5</cbc:URI>
<cbc:DocumentHash>B7+m/6Aq3+UHDBARLcj9tZQJivo=</cbc:DocumentHash>
</cac:ExternalReference>
</cac:Attachment>
</cac:AdditionalDocumentReference>
<cac-place-ext:ValidNoticeInfo>
<cbc-place-ext:NoticeTypeCode listURI="https://contrataciondelestado.es/codice/cl/2.11/TenderingNoticeTypeCode-2.11.gc">DOC_CN</cbc-place-ext:NoticeTypeCode>
<cac-place-ext:AdditionalPublicationStatus>
<cbc-place-ext:PublicationMediaName>BOE</cbc-place-ext:PublicationMediaName>
<cac-place-ext:AdditionalPublicationDocumentReference>
<cbc:IssueDate>2024-06-13</cbc:IssueDate>
</cac-place-ext:AdditionalPublicationDocumentReference>
</cac-place-ext:AdditionalPublicationStatus>
</cac-place-ext:ValidNoticeInfo>
<cac-place-ext:ValidNoticeInfo>
<cbc-place-ext:NoticeTypeCode listURI="https://contrataciondelestado.es/codice/cl/2.11/TenderingNoticeTypeCode-2.11.gc">DOC_CAN_ADJ</cbc-place-ext:NoticeTypeCode>
<cac-place-ext:AdditionalPublicationStatus>
<cbc-place-ext:PublicationMediaName>Perfil del contratante</cbc-place-ext:PublicationMediaName>
<cac-place-ext:AdditionalPublicationDocumentReference>
<cbc:IssueDate>2024-11-27</cbc:IssueDate>
</cac-place-ext:AdditionalPublicationDocumentReference>
</cac-place-ext:AdditionalPublicationStatus>
</cac-place-ext:ValidNoticeInfo>
<cac-place-ext:ValidNoticeInfo>
<cbc-place-ext:NoticeTypeCode listURI="https://contrataciondelestado.es/codice/cl/2.11/TenderingNoticeTypeCode-2.11.gc">DOC_CD</cbc-place-ext:NoticeTypeCode>
<cac-place-ext:AdditionalPublicationStatus>
<cbc-place-ext:PublicationMediaName>Perfil del contratante</cbc-place-ext:PublicationMediaName>
<cac-place-ext:AdditionalPublicationDocumentReference>
<cbc:IssueDate>2024-06-06</cbc:IssueDate>
</cac-place-ext:AdditionalPublicationDocumentReference>
</cac-place-ext:AdditionalPublicationStatus>
</cac-place-ext:ValidNoticeInfo>
<cac-place-ext:ValidNoticeInfo>
<cbc-place-ext:NoticeTypeCode listURI="https://contrataciondelestado.es/codice/cl/2.11/TenderingNoticeTypeCode-2.11.gc">DOC_CN</cbc-place-ext:NoticeTypeCode>
<cac-place-ext:AdditionalPublicationStatus>
<cbc-place-ext:PublicationMediaName>Perfil del contratante</cbc-place-ext:PublicationMediaName>
<cac-place-ext:AdditionalPublicationDocumentReference>
<cbc:IssueDate>2024-06-06</cbc:IssueDate>
</cac-place-ext:AdditionalPublicationDocumentReference>
</cac-place-ext:AdditionalPublicationStatus>
</cac-place-ext:ValidNoticeInfo>
<cac-place-ext:ValidNoticeInfo>
<cbc-place-ext:NoticeTypeCode listURI="https://contrataciondelestado.es/codice/cl/2.11/TenderingNoticeTypeCode-2.11.gc">DOC_FORM</cbc-place-ext:NoticeTypeCode>
<cac-place-ext:AdditionalPublicationStatus>
<cbc-place-ext:PublicationMediaName>Perfil del contratante</cbc-place-ext:PublicationMediaName>
<cac-place-ext:AdditionalPublicationDocumentReference>
<cbc:IssueDate>2024-12-19</cbc:IssueDate>
</cac-place-ext:AdditionalPublicationDocumentReference>
</cac-place-ext:AdditionalPublicationStatus>
</cac-place-ext:ValidNoticeInfo>
<cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocumentDocumentReference>
<cbc:ID>2024-808fc79b-06f9-4f36-9949-667977a5f86d</cbc:ID>
<cbc:DocumentTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.08/GeneralContractDocuments-2.08.gc">14</cbc:DocumentTypeCode>
<cac:Attachment>
<cac:ExternalReference>
<cbc:URI>https://contrataciondelestado.es/wps/wcm/connect/PLACE_es/Site/area/docAccCmpnt?srv=cmpnt&cmpntname=GetDocumentsById&source=library&DocumentIdParam=2024-808fc79b-06f9-4f36-9949-667977a5f86d</cbc:URI>
<cbc:FileName>Informe sobre las ofertas incursas en presunción de anormalidad</cbc:FileName>
</cac:ExternalReference>
</cac:Attachment>
</cac-place-ext:GeneralDocumentDocumentReference>
</cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocumentDocumentReference>
<cbc:ID>2024-715e4b11-0c10-44d2-9127-81a56418ae13</cbc:ID>
<cbc:DocumentTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.08/GeneralContractDocuments-2.08.gc">12</cbc:DocumentTypeCode>
<cac:Attachment>
<cac:ExternalReference>
<cbc:URI>https://contrataciondelestado.es/wps/wcm/connect/PLACE_es/Site/area/docAccCmpnt?srv=cmpnt&cmpntname=GetDocumentsById&source=library&DocumentIdParam=2024-715e4b11-0c10-44d2-9127-81a56418ae13</cbc:URI>
<cbc:FileName>Acta del órgano de asistencia</cbc:FileName>
</cac:ExternalReference>
</cac:Attachment>
</cac-place-ext:GeneralDocumentDocumentReference>
</cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocumentDocumentReference>
<cbc:ID>2024-f761442b-7a0c-44b8-9bd5-7c09187c8ebe</cbc:ID>
<cbc:DocumentTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.08/GeneralContractDocuments-2.08.gc">1</cbc:DocumentTypeCode>
<cac:Attachment>
<cac:ExternalReference>
<cbc:URI>https://contrataciondelestado.es/wps/wcm/connect/PLACE_es/Site/area/docAccCmpnt?srv=cmpnt&cmpntname=GetDocumentsById&source=library&DocumentIdParam=2024-f761442b-7a0c-44b8-9bd5-7c09187c8ebe</cbc:URI>
<cbc:FileName>Actos públicos informativos o de aperturas de ofertas</cbc:FileName>
</cac:ExternalReference>
</cac:Attachment>
</cac-place-ext:GeneralDocumentDocumentReference>
</cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocumentDocumentReference>
<cbc:ID>2024-526c90fa-93d8-4db8-8feb-dc96d6a5bfce</cbc:ID>
<cbc:DocumentTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.08/GeneralContractDocuments-2.08.gc">12</cbc:DocumentTypeCode>
<cac:Attachment>
<cac:ExternalReference>
<cbc:URI>https://contrataciondelestado.es/wps/wcm/connect/PLACE_es/Site/area/docAccCmpnt?srv=cmpnt&cmpntname=GetDocumentsById&source=library&DocumentIdParam=2024-526c90fa-93d8-4db8-8feb-dc96d6a5bfce</cbc:URI>
<cbc:FileName>Acta del órgano de asistencia</cbc:FileName>
</cac:ExternalReference>
</cac:Attachment>
</cac-place-ext:GeneralDocumentDocumentReference>
</cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocumentDocumentReference>
<cbc:ID>2024-1a70d65c-0e41-4302-a9be-4a39a072903e</cbc:ID>
<cbc:DocumentTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.08/GeneralContractDocuments-2.08.gc">12</cbc:DocumentTypeCode>
<cac:Attachment>
<cac:ExternalReference>
<cbc:URI>https://contrataciondelestado.es/wps/wcm/connect/PLACE_es/Site/area/docAccCmpnt?srv=cmpnt&cmpntname=GetDocumentsById&source=library&DocumentIdParam=2024-1a70d65c-0e41-4302-a9be-4a39a072903e</cbc:URI>
<cbc:FileName>Acta del órgano de asistencia</cbc:FileName>
</cac:ExternalReference>
</cac:Attachment>
</cac-place-ext:GeneralDocumentDocumentReference>
</cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocumentDocumentReference>
<cbc:ID>2024-84248c0b-2d31-4307-9e10-0642ab0ac3aa</cbc:ID>
<cbc:DocumentTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.08/GeneralContractDocuments-2.08.gc">12</cbc:DocumentTypeCode>
<cac:Attachment>
<cac:ExternalReference>
<cbc:URI>https://contrataciondelestado.es/wps/wcm/connect/PLACE_es/Site/area/docAccCmpnt?srv=cmpnt&cmpntname=GetDocumentsById&source=library&DocumentIdParam=2024-84248c0b-2d31-4307-9e10-0642ab0ac3aa</cbc:URI>
<cbc:FileName>Acta del órgano de asistencia</cbc:FileName>
</cac:ExternalReference>
</cac:Attachment>
</cac-place-ext:GeneralDocumentDocumentReference>
</cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocumentDocumentReference>
<cbc:ID>2024-476ebe20-72eb-479e-9815-05fc29efd728</cbc:ID>
<cbc:DocumentTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.08/GeneralContractDocuments-2.08.gc">12</cbc:DocumentTypeCode>
<cac:Attachment>
<cac:ExternalReference>
<cbc:URI>https://contrataciondelestado.es/wps/wcm/connect/PLACE_es/Site/area/docAccCmpnt?srv=cmpnt&cmpntname=GetDocumentsById&source=library&DocumentIdParam=2024-476ebe20-72eb-479e-9815-05fc29efd728</cbc:URI>
<cbc:FileName>Acta del órgano de asistencia</cbc:FileName>
</cac:ExternalReference>
</cac:Attachment>
</cac-place-ext:GeneralDocumentDocumentReference>
</cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocumentDocumentReference>
<cbc:ID>2024-96d6f24e-8931-47c4-9feb-a87ed7bddcbe</cbc:ID>
<cbc:DocumentTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.08/GeneralContractDocuments-2.08.gc">13</cbc:DocumentTypeCode>
<cac:Attachment>
<cac:ExternalReference>
<cbc:URI>https://contrataciondelestado.es/wps/wcm/connect/PLACE_es/Site/area/docAccCmpnt?srv=cmpnt&cmpntname=GetDocumentsById&source=library&DocumentIdParam=2024-96d6f24e-8931-47c4-9feb-a87ed7bddcbe</cbc:URI>
<cbc:FileName>Informe de valoración de los criterios de adjudicación cuantificables mediante juicio de valor</cbc:FileName>
</cac:ExternalReference>
</cac:Attachment>
</cac-place-ext:GeneralDocumentDocumentReference>
</cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocumentDocumentReference>
<cbc:ID>2024-3f052589-4887-46d8-9a0a-f821ced98d8a</cbc:ID>
<cbc:DocumentTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.08/GeneralContractDocuments-2.08.gc">1</cbc:DocumentTypeCode>
<cac:Attachment>
<cac:ExternalReference>
<cbc:URI>https://contrataciondelestado.es/wps/wcm/connect/PLACE_es/Site/area/docAccCmpnt?srv=cmpnt&cmpntname=GetDocumentsById&source=library&DocumentIdParam=2024-3f052589-4887-46d8-9a0a-f821ced98d8a</cbc:URI>
<cbc:FileName>Actos públicos informativos o de aperturas de ofertas</cbc:FileName>
</cac:ExternalReference>
</cac:Attachment>
</cac-place-ext:GeneralDocumentDocumentReference>
</cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocumentDocumentReference>
<cbc:ID>f8896783-0abc-48ab-87c1-cf1f5cd7e367</cbc:ID>
<cbc:DocumentTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.08/GeneralContractDocuments-2.08.gc">11</cbc:DocumentTypeCode>
<cac:Attachment>
<cac:ExternalReference>
<cbc:URI>https://contrataciondelestado.es/wps/wcm/connect/PLACE_es/Site/area/docAccCmpnt?srv=cmpnt&cmpntname=GetDocumentsById&source=library&DocumentIdParam=f8896783-0abc-48ab-87c1-cf1f5cd7e367</cbc:URI>
<cbc:FileName>Documento de aprobación del expediente</cbc:FileName>
</cac:ExternalReference>
</cac:Attachment>
</cac-place-ext:GeneralDocumentDocumentReference>
</cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocumentDocumentReference>
<cbc:ID>d93158fa-158c-4ddf-a037-ea8ae1372ddb</cbc:ID>
<cbc:DocumentTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.08/GeneralContractDocuments-2.08.gc">8</cbc:DocumentTypeCode>
<cac:Attachment>
<cac:ExternalReference>
<cbc:URI>https://contrataciondelestado.es/wps/wcm/connect/PLACE_es/Site/area/docAccCmpnt?srv=cmpnt&cmpntname=GetDocumentsById&source=library&DocumentIdParam=d93158fa-158c-4ddf-a037-ea8ae1372ddb</cbc:URI>
<cbc:FileName>Acuerdo de iniciación del expediente</cbc:FileName>
</cac:ExternalReference>
</cac:Attachment>
</cac-place-ext:GeneralDocumentDocumentReference>
</cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocument>
<cac-place-ext:GeneralDocumentDocumentReference>
<cbc:ID>daffb941-c1b3-415a-950a-bcf2c51f13fa</cbc:ID>
<cbc:DocumentTypeCode listURI="http://contrataciondelestado.es/codice/cl/2.08/GeneralContractDocuments-2.08.gc">ZZZ</cbc:DocumentTypeCode>
<cac:Attachment>
<cac:ExternalReference>
<cbc:URI>https://contrataciondelestado.es/wps/wcm/connect/PLACE_es/Site/area/docAccCmpnt?srv=cmpnt&cmpntname=GetDocumentsById&source=library&DocumentIdParam=daffb941-c1b3-415a-950a-bcf2c51f13fa</cbc:URI>
<cbc:FileName>Enlace nuevo a proyecto</cbc:FileName>
</cac:ExternalReference>
</cac:Attachment>
</cac-place-ext:GeneralDocumentDocumentReference>
</cac-place-ext:GeneralDocument>
</cac-place-ext:ContractFolderStatus>
</entry>
Comme vous le voyez, chaque concours a des dimensions considérables et dans chaque fichier, nous pouvons trouver environ 450 concours. Cette dimension ne permet pas d'utiliser une classe d'ObjectScript pour le mappage (on pourrait... mais je ne suis pas prêt à le faire).
Codes pour les tests
Mon idée est de capturer uniquement les champs pertinents pour les recherches ultérieures. Pour ce faire, j'ai créé la classe suivante qui nous servira à stocker les informations capturées:
Class Inquisidor.Object.Licitacion Extends (%Persistent, %XML.Adaptor) [ DdlAllowed ]
{
Property IdLicitacion As%String(MAXLEN = 200);Property Titulo As%String(MAXLEN = 2000);Property URL As%String(MAXLEN = 1000);Property Resumen As%String(MAXLEN = 2000);Property TituloVectorizado As%Vector(DATATYPE = "DECIMAL", LEN = 384);Property Contratante As%String(MAXLEN = 2000);Property URLContratante As%String(MAXLEN = 2000);Property ValorEstimado As%Numeric(STORAGEDEFAULT = "columnar");Property ImporteTotal As%Numeric(STORAGEDEFAULT = "columnar");Property ImporteTotalSinImpuestos As%Numeric(STORAGEDEFAULT = "columnar");Property FechaAdjudicacion As%Date;Property Estado As%String;Property Ganador As%String(MAXLEN = 200);Property ImporteGanador As%Numeric(STORAGEDEFAULT = "columnar");Property ImporteGanadorSinImpuestos As%Numeric(STORAGEDEFAULT = "columnar");Property Clasificacion As%String(MAXLEN = 10);Property Localizacion As%String(MAXLEN = 200);
Index IndexContratante On Contratante;
Index IndexGanador On Ganador;
Index IndexClasificacion On Clasificacion;
Index IndexLocalizacion On Localizacion;
Index IndexIdLicitation On IdLicitacion [ PrimaryKey ];
}
Pour capturer les données à l'aide d'Embedded Python, j'ai utilisé la bibliothèque xml.etree.ElementTree qui nous permet d'extraire les valeurs nœud par nœud. Voici la méthode Python que j'ai utilisée pour le mappage du XML:
Method ReadXML(xmlPath As %String) As %String [ Language = python ]
{
import xml.etree.ElementTree as ET
import iris
import pandas as pd
<span class="hljs-keyword">try</span> :
tree = ET.parse(xmlPath)
root = tree.getroot()
<span class="hljs-keyword">for</span> entry <span class="hljs-keyword">in</span> root.iter(<span class="hljs-string">"{http://www.w3.org/2005/Atom}entry"</span>):
licitacion = {<span class="hljs-string">"titulo"</span>: <span class="hljs-string">""</span>, <span class="hljs-string">"resumen"</span>: <span class="hljs-string">""</span>, <span class="hljs-string">"idlicitacion"</span>: <span class="hljs-string">""</span>, <span class="hljs-string">"url"</span>: <span class="hljs-string">""</span>, <span class="hljs-string">"contratante"</span>: <span class="hljs-string">""</span>, <span class="hljs-string">"urlcontratante"</span>: <span class="hljs-string">""</span>, <span class="hljs-string">"estado"</span>: <span class="hljs-string">""</span>, <span class="hljs-string">"valorestimado"</span>: <span class="hljs-string">""</span>, <span class="hljs-string">"importetotal"</span>: <span class="hljs-string">""</span>, <span class="hljs-string">"importetotalsinimpuestos"</span>: <span class="hljs-string">""</span>, <span class="hljs-string">"clasificacion"</span>: <span class="hljs-string">""</span>, <span class="hljs-string">"localizacion"</span>: <span class="hljs-string">""</span>, <span class="hljs-string">"fechaadjudicacion"</span>: <span class="hljs-string">""</span>, <span class="hljs-string">"ganador"</span>: <span class="hljs-string">""</span>, <span class="hljs-string">"importeganadorsinimpuestos"</span>: <span class="hljs-string">""</span>, <span class="hljs-string">"importeganador"</span>: <span class="hljs-string">""</span>}
<span class="hljs-keyword">for</span> tags <span class="hljs-keyword">in</span> entry:
<span class="hljs-keyword">if</span> tags.tag == <span class="hljs-string">"{http://www.w3.org/2005/Atom}title"</span>:
licitacion[<span class="hljs-string">"titulo"</span>] = tags.text
<span class="hljs-keyword">if</span> tags.tag == <span class="hljs-string">"{http://www.w3.org/2005/Atom}summary"</span>:
licitacion[<span class="hljs-string">"resumen"</span>] = tags.text
<span class="hljs-keyword">if</span> tags.tag == <span class="hljs-string">"{http://www.w3.org/2005/Atom}id"</span>:
licitacion[<span class="hljs-string">"idlicitacion"</span>] = tags.text
<span class="hljs-keyword">if</span> tags.tag == <span class="hljs-string">"{http://www.w3.org/2005/Atom}link"</span>:
licitacion[<span class="hljs-string">"url"</span>] = tags.attrib[<span class="hljs-string">"href"</span>]
<span class="hljs-keyword">if</span> tags.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice-place-ext:schema:xsd:CommonAggregateComponents-2}ContractFolderStatus"</span>:
<span class="hljs-keyword">for</span> detailTags <span class="hljs-keyword">in</span> tags:
<span class="hljs-keyword">if</span> detailTags.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice-place-ext:schema:xsd:CommonAggregateComponents-2}LocatedContractingParty"</span>:
<span class="hljs-keyword">for</span> infoContractor <span class="hljs-keyword">in</span> detailTags:
<span class="hljs-keyword">if</span> infoContractor.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonAggregateComponents-2}Party"</span>:
<span class="hljs-keyword">for</span> contractorDetails <span class="hljs-keyword">in</span> infoContractor:
<span class="hljs-keyword">if</span> contractorDetails.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonAggregateComponents-2}PartyName"</span> :
<span class="hljs-keyword">for</span> name <span class="hljs-keyword">in</span> contractorDetails:
licitacion[<span class="hljs-string">"contratante"</span>] = name.text
<span class="hljs-keyword">elif</span> contractorDetails.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonBasicComponents-2}WebsiteURI"</span>:
licitacion[<span class="hljs-string">"urlcontratante"</span>] = contractorDetails.text
<span class="hljs-keyword">elif</span> detailTags.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice-place-ext:schema:xsd:CommonAggregateComponents-2}ContractFolderStatusCode"</span>:
licitacion[<span class="hljs-string">"estado"</span>] = detailTags.text
<span class="hljs-keyword">elif</span> detailTags.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonAggregateComponents-2}ProcurementProject"</span>:
<span class="hljs-keyword">for</span> infoProcurement <span class="hljs-keyword">in</span> detailTags:
<span class="hljs-keyword">if</span> infoProcurement.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonAggregateComponents-2}BudgetAmount"</span>:
<span class="hljs-keyword">for</span> detailBudget <span class="hljs-keyword">in</span> infoProcurement:
<span class="hljs-keyword">if</span> detailBudget.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonBasicComponents-2}EstimatedOverallContractAmount"</span>:
licitacion[<span class="hljs-string">"valorestimado"</span>] = detailBudget.text
<span class="hljs-keyword">elif</span> detailBudget.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonBasicComponents-2}TotalAmount"</span>:
licitacion[<span class="hljs-string">"importetotal"</span>] = detailBudget.text
<span class="hljs-keyword">elif</span> detailBudget.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonBasicComponents-2}TaxExclusiveAmount"</span>:
licitacion[<span class="hljs-string">"importetotalsinimpuestos"</span>] = detailBudget.text
<span class="hljs-keyword">elif</span> infoProcurement.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonAggregateComponents-2}RequiredCommodityClassification"</span>:
<span class="hljs-keyword">for</span> detailClassification <span class="hljs-keyword">in</span> infoProcurement:
<span class="hljs-keyword">if</span> detailClassification.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonBasicComponents-2}ItemClassificationCode"</span>:
licitacion[<span class="hljs-string">"clasificacion"</span>] = detailClassification.text
<span class="hljs-keyword">elif</span> infoProcurement.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonAggregateComponents-2}RealizedLocation"</span>:
<span class="hljs-keyword">for</span> detailLocalization <span class="hljs-keyword">in</span> infoProcurement:
<span class="hljs-keyword">if</span> detailLocalization.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonBasicComponents-2}CountrySubentity"</span>:
licitacion[<span class="hljs-string">"localizacion"</span>] = detailLocalization.text
<span class="hljs-keyword">elif</span> detailTags.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonAggregateComponents-2}TenderResult"</span>:
<span class="hljs-keyword">for</span> infoResult <span class="hljs-keyword">in</span> detailTags:
<span class="hljs-keyword">if</span> infoResult.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonBasicComponents-2}AwardDate"</span>:
licitacion[<span class="hljs-string">"fechaadjudicacion"</span>] = infoResult.text
<span class="hljs-keyword">elif</span> infoResult.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonAggregateComponents-2}WinningParty"</span>:
<span class="hljs-keyword">for</span> detailWinner <span class="hljs-keyword">in</span> infoResult:
<span class="hljs-keyword">if</span> detailWinner.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonAggregateComponents-2}PartyName"</span>:
<span class="hljs-keyword">for</span> detailName <span class="hljs-keyword">in</span> detailWinner:
<span class="hljs-keyword">if</span> detailName.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonBasicComponents-2}Name"</span>:
licitacion[<span class="hljs-string">"ganador"</span>] = detailName.text
<span class="hljs-keyword">elif</span> infoResult.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonAggregateComponents-2}AwardedTenderedProject"</span>:
<span class="hljs-keyword">for</span> detailTender <span class="hljs-keyword">in</span> infoResult:
<span class="hljs-keyword">if</span> detailTender.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonAggregateComponents-2}LegalMonetaryTotal"</span>:
<span class="hljs-keyword">for</span> detailWinnerAmount <span class="hljs-keyword">in</span> detailTender:
<span class="hljs-keyword">if</span> detailWinnerAmount.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonBasicComponents-2}TaxExclusiveAmount"</span>:
licitacion[<span class="hljs-string">"importeganadorsinimpuestos"</span>] = detailWinnerAmount.text
<span class="hljs-keyword">elif</span> detailWinnerAmount.tag == <span class="hljs-string">"{urn:dgpe:names:draft:codice:schema:xsd:CommonBasicComponents-2}PayableAmount"</span>:
licitacion[<span class="hljs-string">"importeganador"</span>] = detailWinnerAmount.text
iris.cls(<span class="hljs-string">"Ens.Util.Log"</span>).LogInfo(<span class="hljs-string">"Inquisidor.BP.XMLToLicitacion"</span>, <span class="hljs-string">"VectorizePatient"</span>, <span class="hljs-string">"Terminado mapeo "</span>+licitacion[<span class="hljs-string">"titulo"</span>])
<span class="hljs-keyword">if</span> licitacion.get(<span class="hljs-string">"importeganador"</span>) <span class="hljs-keyword">is</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">None</span> <span class="hljs-keyword">and</span> licitacion.get(<span class="hljs-string">"importeganador"</span>) <span class="hljs-keyword">is</span> <span class="hljs-keyword">not</span> <span class="hljs-string">""</span>:
iris.cls(<span class="hljs-string">"Ens.Util.Log"</span>).LogInfo(<span class="hljs-string">"Inquisidor.BP.XMLToLicitacion"</span>, <span class="hljs-string">"VectorizePatient"</span>, <span class="hljs-string">"Lanzando insert "</span>+licitacion[<span class="hljs-string">"titulo"</span>])
stmt = iris.sql.prepare(<span class="hljs-string">"INSERT INTO INQUISIDOR_Object.Licitacion (Titulo, Resumen, IdLicitacion, URL, Contratante, URLContratante, Estado, ValorEstimado, ImporteTotal, ImporteTotalSinImpuestos, Clasificacion, Localizacion, FechaAdjudicacion, Ganador, ImporteGanadorSinImpuestos, ImporteGanador) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,TO_DATE(?,'YYYY-MM-DD'),?,?,?)"</span>)
<span class="hljs-keyword">try</span>:
rs = stmt.execute(licitacion[<span class="hljs-string">"titulo"</span>], licitacion[<span class="hljs-string">"resumen"</span>], licitacion[<span class="hljs-string">"idlicitacion"</span>], licitacion[<span class="hljs-string">"url"</span>], licitacion[<span class="hljs-string">"contratante"</span>], licitacion[<span class="hljs-string">"urlcontratante"</span>], licitacion[<span class="hljs-string">"estado"</span>], licitacion[<span class="hljs-string">"valorestimado"</span>], licitacion[<span class="hljs-string">"importetotal"</span>], licitacion[<span class="hljs-string">"importetotalsinimpuestos"</span>], licitacion[<span class="hljs-string">"clasificacion"</span>], licitacion[<span class="hljs-string">"localizacion"</span>], licitacion[<span class="hljs-string">"fechaadjudicacion"</span>], licitacion[<span class="hljs-string">"ganador"</span>], licitacion[<span class="hljs-string">"importeganadorsinimpuestos"</span>], licitacion[<span class="hljs-string">"importeganador"</span>])
<span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> err:
iris.cls(<span class="hljs-string">"Ens.Util.Log"</span>).LogInfo(<span class="hljs-string">"Inquisidor.BP.XMLToLicitacion"</span>, <span class="hljs-string">"VectorizePatient"</span>, repr(err))
<span class="hljs-keyword">return</span> <span class="hljs-string">"Success"</span>
<span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> err:
iris.cls(<span class="hljs-string">"Ens.Util.Log"</span>).LogInfo(<span class="hljs-string">"Inquisidor.BP.XMLToLicitacion"</span>, <span class="hljs-string">"VectorizePatient"</span>, repr(err))
<span class="hljs-keyword">return</span> <span class="hljs-string">"Error"</span>
}
Une fois le mappage terminé, nous procédons à un simple insert avec l'enregistrement.
Pour le mappage en utilisant ObjectScript, j'ai utilisé la fonctionnalité %XML.TextReader , voyons la méthode:
Method OnRequest(pRequest As Ens.StreamContainer, Output pResponse As Ens.Response) As%Status
{
set filename = pRequest.OriginalFilename
set status=##class(%XML.TextReader).ParseFile(filename,.textreader)
//check statusif$$$ISERR(status) {do$System.Status.DisplayError(status) quit}
set tStatement = ##class(%SQL.Statement).%New()
//iterate through document, node by nodewhile textreader.Read()
{
if ((textreader.NodeType = "element") && (textreader.Depth = 2) && (textreader.Path = "/feed/entry")) {
if ($DATA(licitacion))
{
if (licitacion.ImporteGanador '= ""){
//set sc = licitacion.%Save()set myquery = "INSERT INTO INQUISIDOR_Object.LicitacionOS (Titulo, Resumen, IdLicitacion, URL, Contratante, URLContratante, Estado, ValorEstimado, ImporteTotal, ImporteTotalSinImpuestos, Clasificacion, Localizacion, FechaAdjudicacion, Ganador, ImporteGanadorSinImpuestos, ImporteGanador) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"set qStatus = tStatement.%Prepare(myquery)
if qStatus '= 1 {
write"%Prepare failed:"do$System.Status.DisplayError(qStatus)
quit
}
set rset = tStatement.%Execute(licitacion.Titulo, licitacion.Resumen, licitacion.IdLicitacion, licitacion.URL, licitacion.Contratante, licitacion.URLContratante, licitacion.Estado, licitacion.ValorEstimado, licitacion.ImporteTotal, licitacion.ImporteTotalSinImpuestos, licitacion.Clasificacion, licitacion.Localizacion, licitacion.FechaAdjudicacion, licitacion.Ganador, licitacion.ImporteGanadorSinImpuestos, licitacion.ImporteGanador)
}
}
set licitacion = ##class(Inquisidor.Object.LicitacionOS).%New()
}
if (textreader.Path = "/feed/entry/title"){
if (textreader.Value '= ""){
set licitacion.Titulo = textreader.Value
}
}
if (textreader.Path = "/feed/entry/summary"){
if (textreader.Value '= ""){
set licitacion.Resumen = textreader.Value
}
}
if (textreader.Path = "/feed/entry/id"){
if (textreader.Value '= ""){
set licitacion.IdLicitacion = textreader.Value
}
}
if (textreader.Path = "/feed/entry/link"){
if (textreader.MoveToAttributeName("href")) {
set licitacion.URL = textreader.Value
}
}
if (textreader.Path = "/feed/entry/cac-place-ext:ContractFolderStatus/cbc-place-ext:ContractFolderStatusCode"){
if (textreader.Value '= ""){
set licitacion.Estado = textreader.Value
}
}
if (textreader.Path = "/feed/entry/cac-place-ext:ContractFolderStatus/cac-place-ext:LocatedContractingParty/cac:Party/cac:PartyName"){
if (textreader.Value '= ""){
set licitacion.Contratante = textreader.Value
}
}
if (textreader.Path = "/feed/entry/cac-place-ext:ContractFolderStatus/cac-place-ext:LocatedContractingParty/cac:Party/cbc:WebsiteURI"){
if (textreader.Value '= ""){
set licitacion.URLContratante = textreader.Value
}
}
if (textreader.Path = "/feed/entry/cac-place-ext:ContractFolderStatus/cac:ProcurementProject/cac:BudgetAmount/cbc:EstimatedOverallContractAmount"){
if (textreader.Value '= ""){
set licitacion.ValorEstimado = textreader.Value
}
}
if (textreader.Path = "/feed/entry/cac-place-ext:ContractFolderStatus/cac:ProcurementProject/cac:BudgetAmount/cbc:TotalAmount"){
if (textreader.Value '= ""){
set licitacion.ImporteTotal = textreader.Value
}
}
if (textreader.Path = "/feed/entry/cac-place-ext:ContractFolderStatus/cac:ProcurementProject/cac:BudgetAmount/cbc:TaxExclusiveAmount"){
if (textreader.Value '= ""){
set licitacion.ImporteTotalSinImpuestos = textreader.Value
}
}
if (textreader.Path = "/feed/entry/cac-place-ext:ContractFolderStatus/cac:ProcurementProject/cac:RequiredCommodityClassification/cbc:ItemClassificationCode"){
if (textreader.Value '= ""){
set licitacion.Clasificacion = textreader.Value
}
}
if (textreader.Path = "/feed/entry/cac-place-ext:ContractFolderStatus/cac:ProcurementProject/cac:RealizedLocation/cbc:CountrySubentity"){
if (textreader.Value '= ""){
set licitacion.Localizacion = textreader.Value
}
}
if (textreader.Path = "/feed/entry/cac-place-ext:ContractFolderStatus/cac:TenderResult/cbc:AwardDate"){
if (textreader.Value '= ""){
set licitacion.FechaAdjudicacion = $System.SQL.Functions.TODATE(textreader.Value,"YYYY-MM-DD")
}
}
if (textreader.Path = "/feed/entry/cac-place-ext:ContractFolderStatus/cac:TenderResult/cac:WinningParty/cac:PartyName/cbc:Name"){
if (textreader.Value '= ""){
set licitacion.Ganador = textreader.Value
}
}
if (textreader.Path = "/feed/entry/cac-place-ext:ContractFolderStatus/cac:TenderResult/cac:AwardedTenderedProject/cac:LegalMonetaryTotal/cbc:TaxExclusiveAmount"){
if (textreader.Value '= ""){
set licitacion.ImporteGanadorSinImpuestos = textreader.Value
}
}
if (textreader.Path = "/feed/entry/cac-place-ext:ContractFolderStatus/cac:TenderResult/cac:AwardedTenderedProject/cac:LegalMonetaryTotal/cbc:PayableAmount"){
if (textreader.Value '= ""){
set licitacion.ImporteGanador = textreader.Value
}
}
}
// set resultEmbeddings = ..GenerateEmbeddings()Quit$$$OK
}Les deux codes n'enregistreront dans la base de données que les concours qui ont déjà été résolus (pour lesquels le montant total gagnant a été communiqué).
Configuration de la production
Avec nos méthodes mises en œuvre dans les processus métier correspondants, il ne nous reste plus qu'à configurer la production pour notre test, ce qui nous permettra d'alimenter les deux méthodes. Il suffit d'ajouter deux services métier qui se limiteront à capturer les fichiers avec les informations XML et à les transmettre aux processus métier.
Pour éviter toute interférence lors de la capture et de la transmission des informations aux processus métier, nous allons créer deux services métier. La production se présentera comme suit:
.png)
Pour le test, nous allons introduire les concours publics du mois de février, soit un total de 91 fichiers avec 1,30 Go de données. Voyons comment se comportent les deux codes.
À vos marques...
Prêts...
C'est parti!
Résultats du mappage XML en ObjectScript
Commençons par le temps nécessaire au code ObjectScript pour mapper les 91 fichiers:
.png)
Le premier fichier a été démarré à 21:11:15, voyons quand le dernier fichier a été mappé:
.png)
Si nous regardons les détails du dernier message, nous pouvons voir la date finale du traitement:
.png)
L'heure finale est 21:17:43, ce qui donne un temps de traitement de 6 minutes et 28 secondes.
Résultats du mappage XML en Embedded Python
Répétez la même opération avec le processus qui utilise Python:
.png)
Début à 21:11:15 comme dans le cas précédent, voyons quand l'opération s'est terminée:
.png)
Voyons le message en détail pour connaître la fin exacte:
.png)
L'heure finale était 21:12:03, ce qui nous amène à un total de 48 secondes.
Eh bien, le gagnant est connu ! Dans ce round, Embedded Python a battu ObjectScript, du moins en ce qui concerne l'analyse XML. Si vous avez des suggestions ou des améliorations à apporter au code des deux méthodes, je vous encourage à les mettre dans les commentaires et je répéterai les tests pour vérifier les améliorations possibles.
Ce que nous pouvons dire, c'est qu'en ce qui concerne la supériorité évidente de la performance d'ObjectScript par rapport à Python... le mythe est brisé!
