profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/carlosvega/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Carlos Vega carlosvega University of Luxembourg Luxembourg http://research.cvega.es/ Computer Science PhD at uni.lu working on web-based translational medicine knowledge management.

carlosvega/httpDissector 5

The aim of the application is to show the response times of HTTP requests

carlosvega/edx-video-extension 2

EDX Video Downloader Chrome Extension

carlosvega/elasticGeoIPMaps 2

Choropleth Maps of IP's location obtained from an elasticsearch database

carlosvega/ElasticsearchImporter 2

Generic Elasticsearch Importer

disease-maps/disease-maps.github.io 2

Disease Maps Community website

carlosvega/DiceProbabilities 1

Probabilities of the sum results from rolling n dice with s sides

carlosvega/MadridPollutionData 1

Assignment for the course "Applied Plotting, Charting & Data Representation in Python"

carlosvega/MolecularComparator 1

Molecular Formulæ Comparator

carlosvega/twitterMAP 1

A python script to add trending topic information to elasticsearch

carlosvega/apache_flex_parser 0

Parse Apache logs to JSON format

issue openedCrumpLab/OER_bookdown

PDF figure doesn't show

PDF figure in the interactive book does not show except for the first page.

Screenshot 2021-08-04 at 18 31 02

created time in a month

issue openedcypress-io/cypress-docker-images

Base image for Centos8

Is there any base image for Centos8 and cypress?

It could be similar to #18, but if possible a bit smaller in size 😅

created time in 2 months

issue commentoreillymedia/ethics-datascience

content not included in repo

I just found this other repo. I wanted to contribute to fixing a broken URL in Chapter 1. I've left the details here.

The one about FB reminding people's deaths. I tried to suggest a new link with a pull request to the Gitlab repository but access is restricted. I propose to replace it with this link from archive.org https://web.archive.org/web/20190408164600/https://www.cbc.ca/newsblogs/yourcommunity/2014/12/facebook-apologizes-for-highlighting-painful-memories-with-year-in-review-feature.html

ShanEllis

comment created time in 2 months

issue commentsbmlteam/libsbml

Support for rdf:_1, rdf:_2

Although rdf:li is supported in RDF/XML,rdf:li is not part of the RDF schema and list elements are written as rdf:_1 and rdf:_2, I think it would make sense to support XML annotations written as rdf:_1 at least internally for the function appendAnnotation, so that is then converted to rdf:li. appendAnnotation makes a lot of silent decisions without warning the user, for example removing nodes that it doesn't support as seen above.

carlosvega

comment created time in 2 months

issue openedsbmlteam/libsbml

Support for rdf:_1, rdf:_2

The following annotation is valid XML but it cannot be added as an annotation. The function removes the rdf:_1 elements. However, if these are replaced with rdf:li the annotation works.

<rdf:RDF xmlns:dcterms="http://purl.org/dc/terms/" xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<rdf:Description rdf:about="#compa_rtment">
		<dc:creator>
		<rdf:Bag>
			<rdf:_1>
			<vCard:N>
				<vCard:Family>family</vCard:Family>
				<vCard:Given>name</vCard:Given>
			</vCard:N>
			</rdf:_1>
			<rdf:_2>
			<vCard:N>
				<vCard:Family>family</vCard:Family>
				<vCard:Given>name</vCard:Given>
			</vCard:N>
			</rdf:_2>
		</rdf:Bag>
		</dc:creator>
		<dcterms:created>
			<dcterms:W3CDTF rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2021-07-23T18:53:16.625065+02:00</dcterms:W3CDTF>
		</dcterms:created>
		<dcterms:modified>
			<dcterms:W3CDTF rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2021-07-23T18:53:16.625065+02:00</dcterms:W3CDTF>
		</dcterms:modified>
	</rdf:Description>
</rdf:RDF>

This is how the annotation looks after being added. You can see that the Bag under creator is empty:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:vCard4="http://www.w3.org/2006/vcard/ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/" xmlns:bqmodel="http://biomodels.net/model-qualifiers/">
      <rdf:Description rdf:about="#modelname">
        <dcterms:creator>
          <rdf:Bag/>
        </dcterms:creator>
        <dcterms:created rdf:parseType="Resource">
          <dcterms:W3CDTF>2021-07-23T18:53:16Z</dcterms:W3CDTF>
        </dcterms:created>
        <dcterms:modified rdf:parseType="Resource">
          <dcterms:W3CDTF>2021-07-23T18:53:16Z</dcterms:W3CDTF>
        </dcterms:modified>
      </rdf:Description>
</rdf:RDF>

Useful reference regarding RDF/XML. https://www.w3.org/TR/rdf-syntax-grammar/#section-Syntax-list-elements

RDF has a set of container membership properties and corresponding property elements that are mostly used with instances of the rdf:Seq, rdf:Bag and rdf:Alt classes which may be written as typed node elements. The list properties are rdf:_1, rdf:_2 etc. and can be written as property elements or property attributes as shown in Example 17. There is an rdf:li special property element that is equivalent to rdf:_1, rdf:_2 in order, explained in detail in section 7.4. The mapping to the container membership properties is always done in the order that the rdf:li special property elements appear in XML — the document order is significant. The equivalent RDF/XML to Example 17 written in this form is shown in Example 18.

created time in 2 months

issue commentRDFLib/rdflib

RDF.li not in namespace (since 6.0)

Thanks @niklasl the container Bag utility is working great. It creates elements like _1, _2. Now the problem is on a library that parses XML, (libsbml) that does not recognise that syntax (although it should), but does indeed work when I replace the numbers for li

Thanks for the support and thanks for clarifying this issue to me. You can close my PR and issue.

https://github.com/sbmlteam/python-libsbml/issues/24

carlosvega

comment created time in 2 months

issue openedsbmlteam/python-libsbml

Support for rdf:_1, rdf:_2

The following annotation is valid XML but it cannot be added as an annotation. The function removes the rdf:_1 elements. However, if these are replaced with rdf:li the annotation works.

<rdf:RDF xmlns:dcterms="http://purl.org/dc/terms/" xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<rdf:Description rdf:about="#compa_rtment">
		<dc:creator>
		<rdf:Bag>
			<rdf:_1>
			<vCard:N>
				<vCard:Family>family</vCard:Family>
				<vCard:Given>name</vCard:Given>
			</vCard:N>
			</rdf:_1>
			<rdf:_2>
			<vCard:N>
				<vCard:Family>family</vCard:Family>
				<vCard:Given>name</vCard:Given>
			</vCard:N>
			</rdf:_2>
		</rdf:Bag>
		</dc:creator>
		<dcterms:created>
			<dcterms:W3CDTF rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2021-07-23T18:53:16.625065+02:00</dcterms:W3CDTF>
		</dcterms:created>
		<dcterms:modified>
			<dcterms:W3CDTF rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2021-07-23T18:53:16.625065+02:00</dcterms:W3CDTF>
		</dcterms:modified>
	</rdf:Description>
</rdf:RDF>

This is how the annotation looks after being added. You can see that the Bag under creator is empty:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:vCard4="http://www.w3.org/2006/vcard/ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/" xmlns:bqmodel="http://biomodels.net/model-qualifiers/">
      <rdf:Description rdf:about="#modelname">
        <dcterms:creator>
          <rdf:Bag/>
        </dcterms:creator>
        <dcterms:created rdf:parseType="Resource">
          <dcterms:W3CDTF>2021-07-23T18:53:16Z</dcterms:W3CDTF>
        </dcterms:created>
        <dcterms:modified rdf:parseType="Resource">
          <dcterms:W3CDTF>2021-07-23T18:53:16Z</dcterms:W3CDTF>
        </dcterms:modified>
      </rdf:Description>
</rdf:RDF>

Useful reference regarding RDF/XML. https://www.w3.org/TR/rdf-syntax-grammar/#section-Syntax-list-elements

RDF has a set of container membership properties and corresponding property elements that are mostly used with instances of the rdf:Seq, rdf:Bag and rdf:Alt classes which may be written as typed node elements. The list properties are rdf:_1, rdf:_2 etc. and can be written as property elements or property attributes as shown in Example 17. There is an rdf:li special property element that is equivalent to rdf:_1, rdf:_2 in order, explained in detail in section 7.4. The mapping to the container membership properties is always done in the order that the rdf:li special property elements appear in XML — the document order is significant. The equivalent RDF/XML to Example 17 written in this form is shown in Example 18.

created time in 2 months

issue commentRDFLib/rdflib

RDF.li not in namespace (since 6.0)

Thank you very much for the help and support. Just to clarify. I know that the problem relates to the XML representation of RDF but somehow I think this breaks some compatibility when parsing/creating XML files with certain XML/RDF elements. At least, it should be documented how to keep producing/parsing the files with this new release as we used to do with the previous release.

One quick fix is to set RDF._fail to False but I don't like this solution. Creating a custom URIRef seems like another option. IRC, what the w3c seems to agree is that they must be converted to _1, _2 when a rdf:li is read. This means that there must be a way to read XML files containing rdf.li elements and also to write them.

The conflict between RDF schema and the XML representation has been discussed in W3C but my understanding is that a parser must support such property rdf:li to allow creating XML files.

Useful reference: https://www.w3.org/2000/03/rdf-tracking/#rdf-containers-syntax-vs-schema

Another useful sentence is written here: https://www.w3.org/TR/rdf-syntax-grammar/#section-Syntax-list-elements

Any other names are not defined and should generate a warning when encountered, but should otherwise behave normally.

For example, my code used to do like:

		bqbiol = Namespace("http://biomodels.net/biology-qualifiers/")
		bqmodel = Namespace("http://biomodels.net/model-qualifiers/")
		vcard   = Namespace("http://www.w3.org/2001/vcard-rdf/3.0#")
		graph = rdflib.Graph()
		graph.bind('vCard', vcard)
		graph.bind('dc', DC)
		graph.bind('dcterms', DCTERMS)
		graph.bind('bqbiol', bqbiol)
		graph.bind('bqmodel', bqmodel)
		graph.bind('xsd', XSD)
		description = rdflib.URIRef(f'#{metaId}')
		
		#creator info
		author = ...
		creator_bag_node = rdflib.BNode()
		creator_vcard_node = rdflib.BNode()
		graph.add((description, DC.creator, creator_bag_node))
		graph.add((creator_bag_node, RDF.type, RDF.Bag))
		graph.add((creator_bag_node, RDF.li, creator_vcard_node))
		graph.add((creator_vcard_node, RDF.type, vcard.N))
		graph.add((creator_vcard_node, vcard.Family, rdflib.Literal(author.family_name)))
		graph.add((creator_vcard_node, vcard.Given, rdflib.Literal(author.first_name)))

to generate

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:vCard4="http://www.w3.org/2006/vcard/ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/" xmlns:bqmodel="http://biomodels.net/model-qualifiers/">
        <rdf:Description rdf:about="#modelname">
          <dcterms:creator>
            <rdf:Bag>
              <rdf:li rdf:parseType="Resource">
                <vCard4:hasName rdf:parseType="Resource">
                  <vCard4:family-name>family_name</vCard4:family-name>
                  <vCard4:given-name>first_name</vCard4:given-name>
                </vCard4:hasName>
              </rdf:li>
            </rdf:Bag>
          </dcterms:creator>
        </rdf:Description>
      </rdf:RDF>

How could I generate the same thing with the new release? Should I use URIRef(f'{RDF}li') as @nicholascar recommends?

carlosvega

comment created time in 2 months

Pull request review commentRDFLib/rdflib

Migration from ClosedNamespace to DeclaredNamespace

+from rdflib.namespace.RDF import RDF+from rdflib.term import URIRef+++class RDFVOC(RDF):

I think we have the first consequence of this just here: #1374

hsolbrig

comment created time in 2 months

PullRequestReviewEvent

PR opened RDFLib/rdflib

fixes #1374 adding RDF.li property to its correspoding namespace

Fixes #1374

Proposed Changes

  • Add li property to RDF namespace

To be done

  • Is not on me to decide how to handle _{positive_integer} forms.
+4 -0

0 comment

1 changed file

pr created time in 2 months

issue commentRDFLib/rdflib

RDF.li not in namespace (since 6.0)

Yes but has to be allowed, as stated in https://www.w3.org/TR/rdf-syntax-grammar/#section-Syntax-list-elements otherwise you won't be able to parse XML files with rdf:li elements.

RDF has a set of container membership properties and corresponding property elements that are mostly used with instances of the rdf:Seq, rdf:Bag and rdf:Alt classes which may be written as typed node elements. The list properties are rdf:_1, rdf:_2 etc. and can be written as property elements or property attributes as shown in Example 17. There is an rdf:li special property element that is equivalent to rdf:_1, rdf:_2 in order, explained in detail in section 7.4. The mapping to the container membership properties is always done in the order that the rdf:li special property elements appear in XML — the document order is significant. The equivalent RDF/XML to Example 17 written in this form is shown in Example 18.

Even the W3C RELAX NG Compact Schema for RDF/XML says something about this element:

Also needed to allow rdf:li on all property element productions

since we can't capture the rdf:li rewriting to rdf_<n> in relaxng

Many XML files make use of rdf:li elements, for example SBML models that require proper parsing. What's the alternative then to produce something like:

<rdf:Bag>
<rdf:li rdf:resource="urn:miriam:refseq:NM_014874"/>
</rdf:Bag>

You can find thousands of examples of XML files using rdf:li property in https://www.ebi.ac.uk/biomodels/. For example https://www.ebi.ac.uk/biomodels/BIOMD0000000811#Files

How can we then generate and XML like above's example with the new release of rdflib?

carlosvega

comment created time in 2 months

create barnchcarlosvega/rdflib

branch : fix/1374-RDF.li

created branch time in 2 months

fork carlosvega/rdflib

RDFLib is a Python library for working with RDF, a simple yet powerful language for representing information.

https://rdflib.readthedocs.org

fork in 2 months

issue openedRDFLib/rdflib

Issues with release 6.0

After updating to the newest version of rdflib I started to have the following error whenever I use RDF.li

AttributeError: term 'li' not in namespace 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'

I see that is not defined in 22-rdf-syntax-ns, but is part of RDF.

There is an rdf:li special property element that is equivalent to rdf:_1, rdf:_2 in order, explained in detail in section 7.4. The mapping to the container membership properties is always done in the order that the rdf:li special property elements appear in XML — the document order is significant. The equivalent RDF/XML to Example 17 written in this form is shown in Example 18.

https://www.w3.org/TR/rdf-syntax-grammar/#section-Syntax-list-elements

Note that RDF/XML uses li as a convenience element to avoid having to explicitly number each member. The li element assigns the properties _1, _2, and so on as necessary. The element name li was chosen to be mnemonic with the term "list item" from HTML.

https://www.w3.org/TR/1999/REC-rdf-syntax-19990222/

created time in 2 months